C#.NET Core如何在System.Private.CoreLib.dll中调试System.IO.FileNotFoundException? [英] C# .NET Core How to debug System.IO.FileNotFoundException in System.Private.CoreLib.dll?

查看:2422
本文介绍了C#.NET Core如何在System.Private.CoreLib.dll中调试System.IO.FileNotFoundException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在VS 2017上运行.NET Core Web API应用程序时,

在输出的调试面板中,继续向我显示异常抛出:

When I run .NET Core Web API Application on VS 2017,
In Output's Debug panel, keep showing me Exception throw:

System.Private.CoreLib.dll中的'System.IO.FileNotFoundException'

但是,应用程序运行良好,不会停止或

我知道异常总是意味着需要处理的事情。

However, application runs well without stoping or malfunctioning.
I know Exception always means somthing needs to be cared.

因此,如何搜索未找到文件何时运行CoreCLR?

So, how can I search what File is Not Found when run CoreCLR?

-------------更多-------------------

------------- more -------------------

'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Private.Xml.Linq.dll'. Symbols loaded.
'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Private.Xml.dll'. Symbols loaded.
'dotnet.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.0.0\System.Resources.ResourceManager.dll'. Symbols loaded.
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll


推荐答案

转到Debug / Windows / Exception Settings并在Common Language Runtime Exceptions下检查FileNotFoundException。抛出异常后,调试器将停止运行,您将能够看到发生了什么。

Go to Debug/Windows/Exception Settings and check FileNotFoundException under Common Language Runtime Exceptions. The debugger will stop when the exception is thrown and you will be able to see what is going on.

请注意,在异常中预期并处理异常并不罕见。某些情况下。您可能会发现该异常是预期的和已处理的,无需执行任何操作即可对其进行修复。

Note that it is not unusual for exceptions to be expected and handled in some cases. You may find that the exception is expected and handled, and nothing needs to be done to fix it.

这篇关于C#.NET Core如何在System.Private.CoreLib.dll中调试System.IO.FileNotFoundException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆