Skip to main content

Posts

Showing posts with the label Visual Studio

Microsoft Visual C++ Runtime Library - Debug Assertion Failed!

Microsoft Visual C++ Runtime Library - Debug Assertion Failed! Running an application in a debug environment throws the following assertion message. --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Debug Assertion Failed! Program: x:\test\myapp.exe File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp Line: 996 Expression: __acrt_first_block == header For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. (Press Retry to debug the application) --------------------------- Abort   Retry   Ignore    --------------------------- In my specific case, this was caused by a string created in the heap by a DLL and freed in the executable.  The DLL was built using /MDd [ Configuration Properties | C/C++ | Code Generation | Runtime Library = Multi-threaded Debug DLL (/MDd) ] and the executable was built /MTd with MFC as static library [ Configuration Properties | C/C++ | Code Generation | Runti

C++/WinRT Hello World

C++/WinRT Hello World This is a quick start quide to prepare a development environment to develop against C++/WinRT. System: Development OS: Windows 10 Pro 22H2 Target: Windows 10 LTSB build 10.0.14393 IDE: Visual Studio 2022 (used 17.4.4) Install Visual Studio 2022 Universal Windows Platform development workload. The following is very _important_ as this is what will allow you to create C++/WinRT project. Check C++ (v143) Universal Windows Platform tools , doing so will also enable and install corresponding SDK. Set back and relax as this will download ~24GB of data from Microsoft. After installing Visual Studio, create Windows Console Application (C++/WinRT) For the Minimum version, select Windows 10 Anniversary Update (10.0; Build 14393) The template should look like below If all is well, running it should look like below Keywords: Visual Studio, C++/WinRT

Getting the last error code while debugging even if the Win32 API returned value was not saved

Getting the last error code while debugging even if the Win32 API returned value was not saved It is not uncommon that a Win32 API call return value is not checked in code. This information can prove to be very invaluable while debuging. Fortunately, Visual Studio saves pseudovariables which includes the value normally returned by GetLastError function. To view what would have returned by GetLastError use $err,hr in the Watch window. Refs: Visual Studio Pseudovariables Tags: Visual Studio, CPP

Visual Studio 2022 not running unit tests

Visual Studio 2022 not running unit tests I have projects with unit tests working properly using Visual Studio 2019. Installed Visual Studio 2022 on another machine to try it out, running Nunit unit tests does nothing. It does not say it failed nor indicate something is wrong. It was actuallying failing but I am not looking at the correct output log. As you observe from the above screen capture, the default log shows Build output. What you wanted is the log for Tests . See below for the correct view. The Tests output shows the issue front and center. The tests were failing because it was configured to use .Net Core 3.1.x but it was not avaiable on the machine. One way to fix it is to use Visual Studio Installer and select .NET Core 3.1 Runtime (LTS) .

My Visual Studio 2019 Tools and Extensions

Tools and Extensions that I normally use with my Visual Studio installation   DPack Major features can be found under Tools|DPack menu and include: Code Browser - used for individual file code members navigation File Browser - used for solution files navigation Solution Browser - used for the entire solution code members navigation Numbered Bookmarks Surround With Code Navigation Solution Statistics Solution Backup   Microsoft Visual Studio Installer Projects by Microsoft      Use it for authoring installer Power Commands for Visual Studio by Microsoft DevLabs      I mostly use the Copy/Paste References

How to: Install Visual Studio 2012 Update 1 Offline

Inspired by Rob Caron's blog on installing VS2012 Update 1 offline. Below shows how to download without user interaction with the GUI. C:\> vsupdate_KB2707250.exe /layout f:\tmp /passive Of course you need to download the installer first, see this link . It is assumed that vsupdate_KB2707250.exe is in the system path or in the root of drive C:. And you have enough space in drive F:\. References: http://blogs.msdn.com/b/robcaron/archive/2012/11/26/how-to-install-visual-studio-2012-update-1-offline.aspx

VC++ 2008 link crash

I am getting the following crash in VC++2008: Linking... Embedding manifest... Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 Copyright (C) Microsoft Corporation.  All rights reserved. LINK : fatal error LNK1000: Internal error during IncrBuildImage It turns out that this a bug of a VC++ 2008 linker, see hotfix 948127 from Microsoft. ~TS