Debugging

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies.

Are you getting the error below when working with Silverlight projects? Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. It's a bit of an odd one. The solution that works for me is to re-register System.Core and System.Windows in the GAC. Use the commands below. 32 Bit System "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil" /i "C:\Program Files\Microsoft Silverlight\4.1.10111.0\System.Core.dll" "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil" /i "
Read more

Debugger:: An unhandled non-continuable exception was thrown during process load

The following exception can be a very tricky one to deal with: Debugger:: An unhandled non-continuable exception was thrown during process load here's some tips if you get it. Are you linking to winmm.lib? If so avoid it - it can cause these problems. Are you delay-loading the module? If not, try it - this can often resolve this issue if other modules like winmm.lib are interfering with the module that causes this exception.
Read more

How to Debug a Visual Studio Extension

Here are a few tips for debugging Visual Studio Extensions. Visual Studio 2008/2010 If you need to debug your Visual Studio extension, you may find that Visual Studio itself locks it. This is a real drag - to resolve this issue, add the following as a pre-build step: if exist "$(TargetPath).locked" del "$(TargetPath).locked" if not exist "$(TargetPath).locked" if exist "$(TargetPath)" move "$(TargetPath)" "$(TargetPath).locked" This will ensure the locked file is moved out of the way first - very useful!
Read more

Visual Studio Code Analysis - Buffer Overruns

Today I was looking through some fairly old source code in a large solution, large in this case is ~300 projects and about 1 million lines of code. Parts of the code base are very old - at some stage a decision was made to disable warning C4996. The problem I came across is reduced to its most simple form below: // AnalysisExample.cpp : An example of how static analysis can help.
Read more