Learn to use Visual Studio, Visual Studio Online, Application Insights and Team Foundation Server to decrease rework, increase transparency into your application and increase the rate at which you can ship high quality software throughout the application lifecycle
More videos »
Hello, I am Patrick Nelson, a developer on the Visual Studio Debugger Team.
Authoring apps that are using more than one language is not uncommon these days. For example, some developers prefer one language for the UI layer but use another language (or reuse components in another language) for their business logic. When debugging such apps, most of the time you are either debugging one language or the other (and you select which debugger type you want to use through the project properties), but sometimes you need to have the debugger attached to both. In other words, you want to be using both debugger engines at the same time. It is for this reason that in VS2012 Update 1 we enabled and blogged about interop debugging between Managed and Native code in the same app.
Before delving into the VS2013 experience, it is worth pointing out that even with Visual Studio 2012, it is possible to debug both code types of the same app simultaneously by starting debugging in one instance of Visual Studio, and then opening another instance of Visual Studio to attach to the same process but with a different debug engine selected (in the project properties)
There are some disadvantages to using this workaround including:
To select this new debugger type, go to project properties –> debugging and for “Debugger Type” select “Native with Script”
Now when you start debugging, you’ll notice the active script documents load in the solution view as they do when Script debugging:
Say we are debugging an app that crashes on startup. If we debug it with Script Only, all we see is an unhandled exception in WWAHost and the Visual Studio Just-In-Time debugger:
If we debug with Native only, we get a bit more information. We see a divide by zero first chance exception in FolderInfo.h by looking at the Output window. To see why we are getting the divide by zero error, we can temporarily enable break on divide by zero exception via Debug -> Exceptions:
Running it again with break on first chance exceptions thrown, we see the divide by zero error is being caused because m_ImageList->Size is zero. Unfortunately, the deep call stack provides no clue as to how we got here except that we came from jscript9.dll:
Here we see that the folder we are looking at is “Pictures” and there are no images in that folder. This is the cause of the divide be zero error. If we add a picture to the pictures folder the divide by zero exception goes away. We found and verified a possible fix.
By the way, now is a good time to turn off break on divide by zero exceptions so we don’t get extra noise during future debugging sessions.
If you want to try this yourself, you can download the sample program I used to create this post.
We are actively looking for feedback on both this and other diagnostics features so please stop by our MSDN support forum and let us know what you think.
Thank you for your feedback!
This feature sounded so cool. Much nicer than Firebug & similar browser based tools. So I spent the last few days searching for ways to get the Debug Menuitem to appear in the Project (or Solution) properties page. I installed & reinstalled VS2013, Tried heaps of projects to no avail.
Patrick: Can you confirm this feature only works with Windows Store projects?
Thank you for the feedback!
The specific issue is that "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line. Possible causes include: conditional compiliation, compilier optimizations, or the target architecture of this line is not supported by the current debugger code type."
Thanks in advance.
Can you contact us at email@example.com? This may be easier to troubleshoot over email. It would be most helpful if you could provide detailed repro steps about what you are trying to do and the results you are seeing (what type of project, does it happen for all the projects you tried or a particular one, what do you do - set a BP, F5, etc.) and a simple repro project.