I created an Extension SDK which basically consists of a Windows Runtime component that I have written using C++/CX. I did this so I can make my component available to developers building Windows 8 Store apps in any language (C++, C# or JavaScript).
The SDK works fine on my local machine. I can build and run my app locally both in debug and release configurations. However when I try to remote debug my app on a remote machine, I notice that my app fails when trying to use the component from my SDK. Oddly enough, this failure happens only when my app is running in Debug mode. In release mode, everything works fine.
What am I doing wrong?
Using Visual Studio 2012
I think I figured out. I included the same binary of the C++/CX WinRT component in both Debug and Retail folders under redist folder of my Extension SDK.
As a result this binary always has a dependency on the release CRT from Visual Studio 2012.
Now when I run the release version of my app remotely, both the app binary and SDK component binary depend on release CRT. And release CRT is also found on the system since the app has a dependency on the release VCLibs package. So the release app works fine.
However when I run the debug version of my app remotely, the app depends on debug CRT from Visual Studio 2012 but the SDK component depends on the release CRT. Since the app has a dependency only on the debug VCLibs package, it find only the debug CRT at runtime. Therefore the SDK component fails to load.
The solution is to ensure that when you create your SDK, your release binary depends on release CRT and your debug binary depends on debug CRT.
For more information about how C++ Runtime works for Windows Store apps, see the following link:
http://blogs.msdn.com/b/vcblog/archive/2012/09/28/10354327.aspx
Update that it now works in Visual Studio 2013
Using Visual Studio 2013
In Visual Studio 2013 the VCLibs debug AppX package contains both the Debug and Release CRT DLLs. So, in debug configuration, the app depends on the Debug CRT and the Extension SDK binaries depend on the Release CRT. Both of the DLLs are found in the VCLibs Debug AppX package. So it works.