Select to view content in your preferred language

Debugging your SOE on Windows 8

3461
2
10-24-2012 01:15 PM
RichardWatson
Deactivated User
I have been working on getting my SOE running in 10.1 on Windows 8 using Visual Studio 2012.

One of the things that I have found very helpful is to have the following code in my SOE constructor:

            // If we are running with the code compiled using the Debug configuration then launch the debugger.
            // Comment this line out if you do not wish to debug within the context of the SOC process.  The
            // best way to do this is to configure the map service to only launch a single instance.
            #if DEBUG
            Debugger.Launch();
            #endif

This has worked well for me on Windows 7 and XP.  When this code is invoked then the Visual Studio Just-In-Time debugging dialog is displayed which allows you to, or not to, start debugging at the line of code which called Launch.  Unfortunately, this does not work in Windows 8.

I spent some time debugging this and finally worked it out with Microsoft support.  I share the solution with all of you here as a community service.  All I ask in return is that if this helps you then mark this post as helpful.

The secret lies in changing the registry key for the Visual Studio JIT debugger via the following:

reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f

Before making this change the value on my machine was 0x28.  The above changes it to 0x8.  In essence it removes the 0x20 flag.

If you search the Microsoft include files (WTypesbase.h) then you find the following:

#define APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY 0x20

Once you make this change then the JIT debugging window is displayed again.  I believe that all of this relates to various session 0 security changes made by Microsoft.

Happy debugging!
Tags (2)
0 Kudos
2 Replies
nicogis
MVP Alum
Thank you for info
0 Kudos
MichaelEber
Deactivated User
This is also true if you are running the SOE services on a server operating system.  Thanks to this post I was able to find the AppIDFlags, confirm that they were set to 0x00000028 and change it to 0x00000008 for debugging on the server.

BTW -- we are running Windows Server 2008 R2 Enterprise.
0 Kudos