gpt4 book ai didi

c# - 调试器正在寻找 executioncontext.cs,如何修复?

转载 作者:可可西里 更新时间:2023-11-01 07:53:04 28 4
gpt4 key购买 nike

我正在调试这段代码,当调试器到达 Jtoken 行时,我得到一个奇怪的“未找到源”页面,该页面正在寻找名为 ExecutionContext.cs 的此类。

ExecutionContext.cs not found.
You need to find the ExecutionContext.cs to view the source for the current call stack frame.

(有关更多信息,请参见下文)

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RestSharp;

IRestResponse content = myApi.GetSomething();
JToken token = JObject.Parse(content.ToString());
MyClass myclass = token.ToObject<Myclass>();

我也试过用 dynamic 或 var 替换 Jtoken,结果相同。我用谷歌搜索了一下,除了 MS 文档外什么都没有,但对修复没有帮助。

关于如何让它执行或至少抛出一个我可以修复的正常异常有什么建议吗?

谢谢

Locating source for 'f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs'. (No checksum.) The file 'f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs' does not exist.

Looking in script documents for 'f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs'...

Looking in the projects for 'f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs'. The file was not found in a project. Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cvt\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\msclr\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sys\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\thr\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\amd64\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\arm\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\concrt\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\i386\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\linkopts\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\stl\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\vccorlib\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\vcruntime\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\mfc\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\src\atl\'...

Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\'...

The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs.
The debugger could not locate the source file 'f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs'.

最佳答案

调试设置以某种方式被更改并启用了 Just My Code设置将其恢复为正常的托管异常抛出。为此,请转到

Debug > Options... > Debugging > General > Enable Just My Code

关于c# - 调试器正在寻找 executioncontext.cs,如何修复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38947859/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com