Part 2: Troubleshooting VC++ Side by Side Problems

Troubleshooting side by side problems is not a challenging task unless you break the basic checks which are required to successfully run your application. These rules help you track the problem area in your application at the first stage. For more information, see Part 1: Troubleshooting VC++ Side by Side Problems. This blog attempts to help you troubleshoot…

23

‘AlwaysCreate’ forces project to be re-built

Issue Have you lost time because Visual Studio always thought that a project was out-of-date? Recently had a customer who faced this issue. He migrated his project from VS2008 to VS2010. Rebuilt the whole project and tried to run. He saw this message box pop up…   If you click ‘Cancel’ and do a build,…

19

Part 1: Troubleshooting VC++ Side by Side Problems

Let’s go back to the older days, when code sharing was an integral decision taken by application developers. Code sharing allowed developers to write efficient and light-weight applications with less memory utilization. Creating a shared component in the form of Dynamic Link Library (DLL) soon became an obvious choice to achieve code sharing. However, there…

13

Having common intermediate directory causes all project targets to be deleted

While debugging one of my customers’ scenarios, we came across an interesting issue were if we ‘rebuild’ the application we get a warning for a missing file, and for the same application when we ‘build’ everything works fine. All this occurs only in VS2010 and not in the earlier versions of Visual Studio. To understand…


Troubleshooting PInvoke Related Issues

I am back with some more PInvoke Stuff.  Recently I was working on a PInvoke issue which I found interesting.  I have a C++ dll which has a function whose signature is int TestFunc(IN_STRUCT in_Params, RET_STRUCT * pret_Par).  I wanted to call this function from C#.  Function has two arguments.  First argument is input structure…

12

Troubleshooting Manifest-Related Issues

After migrating to Visual Studio 2008 SP1 and building the application, the manifest file of application and all the dependent DLL’s contain RTM version. In Visual Studio 2008 SP1, by design, the manifest for the created exe links it to the RTM version of the CRT. In Visual Studio 2005 SP1, by design, the manifest…

8

The "GenerateResource" Task Failed Unexpectedly : Unable to load FileTracker.dll

When building a project in Visual Studio 2010 that contains a .resx file, you may receive the following build error:   The “GenerateResource” task failed unexpectedly. System.DllNotFoundException: Unable to load DLL ‘FileTracker.dll’: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) at Microsoft.Build.Shared.NativeMethodsShared.InprocTracking.StartTrackingContextWithRoot(String intermediateDirectory, String taskName, String rootMarker)    at Microsoft.Build.Utilities.FileTracker.StartTrackingContextWithRoot(String intermediateDirectory, String…

7

MFC application crashes in Windows 8 touch Devices.

Recently we had a chance to debug an issue where an application was only crashing in Windows 8 Touch devices , it crashed with EXCEPTION_CODE: (NTSTATUS) 0xc000041d – An unhandled exception was encountered during a user callback. . As usual we had taken full memory dumps for the application . From the dumps I saw that…

7

P/Invoke Marshal.StructuretoPtr

In this blog I am going to talk about Marshal.StructuretoPtr , especially its last parameter fDeleteOld. Although its msdn description is pretty concise but I have seen it to be a source of confusion a lot of times. Following is what it says: fDeleteOld Type: System..::.Booleantrue to have the Marshal..::.DestroyStructure method called on the ptr…

7

Unexpected Out of Memory Exception in .Net 4.5 Applications that uses Custom Stack Commit Size

Recently I worked with a developer who was seeing an Unexpected Out of Memory Exception from his .Net 4.5 Application that was using custom stack reserve and commit sizes for the application. He was setting the values in Visual Studio as shown below This particular application had some code that create new AppDomain using AppDomain.CreateDomain()…

5