C# .NET Core How to debug System.IO.FileNotFoundException in System.Private.CoreLib.dll?

若如初见. 提交于 2020-01-21 11:43:08

问题


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

'System.IO.FileNotFoundException' in System.Private.CoreLib.dll

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

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

回答1:


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.



来源:https://stackoverflow.com/questions/46721530/c-sharp-net-core-how-to-debug-system-io-filenotfoundexception-in-system-private

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!