找不到.cs文件来调试.NET源代码

时间:2023-01-19 00:06:48

I tried setting up debugging the .NET source by following this MDSN walkthrough. The Symbol cache is setup properly, as is the check 'Enable .NET Framework source stepping'.

我尝试通过遵循此MDSN演练来设置调试.NET源代码。符号缓存已正确设置,检查“启用.NET Framework源步进”也是如此。

But subsequently, whenever I want to step into .NET code, I am prompted to specify the location of the relevant cs file. The error message is You need to find <filename>.cs to view the source for the current call stack frame and The debugger could not locate the source file <filename>.cs.

但随后,每当我想进入.NET代码时,都会提示我指定相关cs文件的位置。错误消息是您需要找到 .cs来查看当前调用堆栈帧的源,并且调试器找不到源文件 .cs。

I am offered to browse for the file (but I don't have it) or view a disassembly (but I don't want that).

我被提议浏览文件(但我没有它)或查看反汇编(但我不希望这样)。

How to step into the .NET source code?

如何进入.NET源代码?

3 个解决方案

#1


34  

Well, in my case I was not trying to debug the .Net framework, but I was getting the same error: Cannot find .cs files for debugging .NET source code. So I had to turn on the "Enable just my code" option under:
Tools -> Options -> Debugging -> General -> Enable just my Code

好吧,在我的情况下,我没有尝试调试.Net框架,但我得到了同样的错误:找不到.cs文件来调试.NET源代码。所以我必须在“工具 - >选项 - >调试 - >常规 - >启用我的代码”下打开“仅启用我的代码”选项

Per MS docs:

按MS文档:

You can configure Visual Studio to automatically step over system, framework, and other non-user calls and collapse those calls in the call stack window.

您可以将Visual Studio配置为自动切换系统,框架和其他非用户调用,并在调用堆栈窗口中折叠这些调用。

https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code

https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code

#2


18  

Checking Tools -> Options -> Debugging -> General -> Enable source server support mysteriously made everything work. I hope the same is true for you

检查工具 - >选项 - >调试 - >常规 - >启用源服务器支持神秘地使一切正常。我希望你也是如此

#3


4  

This took me an hour as well. I fixed it finally by resetting the Settings -> Tools -> Import and Export Settings -> Resett

这花了我一个小时。我最后通过重置设置 - >工具 - >导入和导出设置 - >重置来修复它

#1


34  

Well, in my case I was not trying to debug the .Net framework, but I was getting the same error: Cannot find .cs files for debugging .NET source code. So I had to turn on the "Enable just my code" option under:
Tools -> Options -> Debugging -> General -> Enable just my Code

好吧,在我的情况下,我没有尝试调试.Net框架,但我得到了同样的错误:找不到.cs文件来调试.NET源代码。所以我必须在“工具 - >选项 - >调试 - >常规 - >启用我的代码”下打开“仅启用我的代码”选项

Per MS docs:

按MS文档:

You can configure Visual Studio to automatically step over system, framework, and other non-user calls and collapse those calls in the call stack window.

您可以将Visual Studio配置为自动切换系统,框架和其他非用户调用,并在调用堆栈窗口中折叠这些调用。

https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code

https://docs.microsoft.com/en-us/visualstudio/debugger/just-my-code

#2


18  

Checking Tools -> Options -> Debugging -> General -> Enable source server support mysteriously made everything work. I hope the same is true for you

检查工具 - >选项 - >调试 - >常规 - >启用源服务器支持神秘地使一切正常。我希望你也是如此

#3


4  

This took me an hour as well. I fixed it finally by resetting the Settings -> Tools -> Import and Export Settings -> Resett

这花了我一个小时。我最后通过重置设置 - >工具 - >导入和导出设置 - >重置来修复它