问题
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