Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to debug with F5 from visual studio 2013, modules window is empty

I am trying to debug a program using start external program in Visual Studio 2013. All project files are .NET 3.5. As a sidenote: I have debugged like this since i updated to VS2013 (about two weeks), but today it suddently stopped working.

When I run the program it starts, but the Debug->Windows->Modules window is empty.

When I start the program and attach Visual Studio to process with Managed (v3.5, v3.0, v2.0) code everything loads smoothly and I am able to debug. But when I choose Managed (v4.5, v4.0) code I get the same blank modules window as above and no active breakpoints.

Could it be that start external program uses the Managed (v4.5, v4.0) code instead of Managed (v3.5, v3.0, v2.0) code? And is there any way to control which debugger Visual Studio uses when using start external program?

I have double checked that all project that builds with the debug-configuration is set to .NET 3.5 since my first thought was that one of the projects might build in a higher version. One project is .NET4.0 but is not set to build in my configuration.

like image 760
soberga Avatar asked Apr 03 '14 11:04

soberga


People also ask

How do I enable debugging code in Visual Studio?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.

What is Ctrl F5 in Visual Studio?

F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.


1 Answers

After some research I ended up adding a .config-file for each version of the executable. The config-file must be named ExecutableNameHere.exe.config.

Here is the config I used for setting the active debugger to .NET 3.5:

<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>

Just save the file in the same directory as the executable and the next time you debug it will use this .NET version.

For other .NET versions, replace version with the following:

  • .NET Framework 1.0: "v1.0.3705"
  • .NET Framework 1.1: "v1.1.4322"
  • .NET Framework 2.0, 3.0, and 3.5: "v2.0.50727"
  • .NET Framework 4 and 4.5 (including point releases such as 4.5.1): "v4.0"

Reference: http://msdn.microsoft.com/en-us/library/jj152935(v=vs.110).aspx

like image 160
soberga Avatar answered Oct 04 '22 06:10

soberga