“The breakpoint will not currently be hit. The sou

2020-01-23 10:30发布

When debugging in Visual Studio, sometimes I add a breakpoint but it's hollow and VS says "The breakpoint will not currently be hit. The source code is different from the original version." Obviously this prevents me from being able to debug.

What on earth does the message mean? What original version? If I've just opened up the solution and not made any changes whatsoever to the code, how can there be an 'original version'?

30条回答
2楼-- · 2020-01-23 10:42

This can happen when the system time changes while debugging or between debug sessions, be it programmatically, manually or by an external program.

查看更多
爷的心禁止访问
3楼-- · 2020-01-23 10:42

First I tried from command line;

deleting temp files from command line did work.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files>rd /s root

When I disable "Enable Just My Code" option in Tools -> Options -> Debugging -> General

The problem resolved for me. It is a WCF application, was trying to debug an ashx page. http://blogs.msdn.com/b/zainnab/archive/2010/10/25/understanding-just-my-code.aspx

查看更多
家丑人穷心不美
4楼-- · 2020-01-23 10:44

Under Windows 7, Visual Studio Express 2010, if you have activated the option Use compatibility mode for Windows XP SP3, this error may occur.

I unchecked the option and it worked perfect again. Right-click on the shortcut to VS or the executable, select properties and then compatibility.

查看更多
欢心
5楼-- · 2020-01-23 10:47

Closing Visual Studio and reopening the solution can fix the problem, i.e. it's a bug within the IDE itself (I'm running VS2010).

If you have more than one instances of Visual Studio running, you only need to close the instance running the solution with the problem.

查看更多
SAY GOODBYE
6楼-- · 2020-01-23 10:47

You can get this message when you are using an activator and the assembly you set the breakpoint into has not been loaded yet.

The breakpoint will resolve once the activator loads the assembly (assuming the assembly and debug symbols are up to date). A good place to look at is the modules window in the debugging menu. There you should look for the assembly which your file belongs too. First check that the assembly is loaded. Then, from where is it loaded? Then, is the symbols file loaded. Again, where is the symbols file loaded from? Finally check the versions of both.

查看更多
祖国的老花朵
7楼-- · 2020-01-23 10:47

If you have more than one projects in your solution, then make sure that the correct project is set as the StartUp Project. To set a particular project as the Startup Project of your solution, Right-click the project, choose Set As StartUp Project.

After I set my StartUp Project correctly, desired break-point was reached by the thread.

查看更多
登录 后发表回答