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?
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.
Exception tells me 'Microsoft.AspNetCore.DataProtection.resources' file is missing.
But, I installed 'Microsoft.AspNetCore.DataProtection' Nuget Package.
Exception does not give me a specific path to look into...
Also, What is "System.Private.CoreLib.dll"?
What is the stacktrace of the exception?
System.Private.CoreLib.dll is assembly that contains the implementation of the lowest level types like System.String in .NET Core.
System.IO.FileNotFoundException occurred
HResult=0x80070002
Message=Could not load the specified file.
Source=System.Private.CoreLib
StackTrace:
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) in E:A_work\376\ssrc\mscorlibsrc\System\Runtime\LoaderAssemblyLoadContext.cs:line 269
System.Private.CoreLib.dll!System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(System.IntPtr gchManagedAssemblyLoadContext, System.Reflection.AssemblyName assemblyName) Line 188 C# Symbols loaded.
Are you able to see the whole stack trace (e.g. in the debugger stacktrace window)?
Microsoft.AspNetCore.DataProtection.resources suggests that the exception is related to localized resource probing.
Sorry for late reply.
System.Private.CoreLib.dll!System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName assemblyName) Line 266 C# Symbols loaded.
System.Private.CoreLib.dll!System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(System.IntPtr gchManagedAssemblyLoadContext, System.Reflection.AssemblyName assemblyName) Line 188 C# Symbols loaded.
[Native to Managed Transition] Annotated Frame
[Managed to Native Transition] Annotated Frame
System.Private.CoreLib.dll!System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(string name, System.Globalization.CultureInfo culture, System.Version version, bool throwOnFileNotFound, ref System.Threading.StackCrawlMark stackMark) Line 863 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(System.Globalization.CultureInfo lookForCulture, ref System.Threading.StackCrawlMark stackMark) Line 432 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo culture, System.Collections.Generic.Dictionary<string, System.Resources.ResourceSet> localResourceSets, bool tryParents, bool createIfNotExists, ref System.Threading.StackCrawlMark stackMark) Line 84 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo requestedCulture, bool createIfNotExists, bool tryParents, ref System.Threading.StackCrawlMark stackMark) Line 692 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) Line 652 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ResourceManager.GetString(string name, System.Globalization.CultureInfo culture) Line 1159 C# Symbols loaded.
System.Private.CoreLib.dll!System.Resources.ResourceManager.GetString(string name) Line 1088 C# Symbols loaded.
Microsoft.AspNetCore.DataProtection.dll!Microsoft.AspNetCore.DataProtection.Resources.GetString(string name, string[] formatterNames) Line 379 C# Symbols loaded.
Microsoft.AspNetCore.DataProtection.dll!Microsoft.Extensions.Logging.LoggingExtensions.LoggingExtensions() Line 387 C# Symbols loaded.
[Native to Managed Transition] Annotated Frame
[Managed to Native Transition] Annotated Frame
Microsoft.AspNetCore.DataProtection.dll!Microsoft.Extensions.Logging.LoggingExtensions.UsingProfileAsKeyRepositoryWithDPAPI(Microsoft.Extensions.Logging.ILogger logger, string fullName) Line 781 C# Symbols loaded.
Microsoft.AspNetCore.DataProtection.dll!Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.GetFallbackKeyRepositoryEncryptorPair() Line 499 C# Symbols loaded.
Microsoft.AspNetCore.DataProtection.dll!Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.XmlKeyManager(Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions> keyManagementOptions, Microsoft.AspNetCore.DataProtection.Internal.IActivator activator, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) Line 91 C# Symbols loaded.
[Native to Managed Transition] Annotated Frame
[Managed to Native Transition] Annotated Frame
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 22 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 16 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 46 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 41 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 20 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 22 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 16 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 46 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 41 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 20 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 22 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 16 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 46 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 41 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 20 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(Microsoft.Extensions.DependencyInjection.ServiceLookup.IEnumerableCallSite enumerableCallSite, Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 93 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceProvider, object>.VisitCallSite(Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceProvider argument) Line 14 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceProvider.RealizeService.AnonymousMethod__0(Microsoft.Extensions.DependencyInjection.ServiceProvider provider) Line 102 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(System.Type serviceType) Line 68 C# Symbols loaded.
Microsoft.Extensions.DependencyInjection.Abstractions.dll!Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService<System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Hosting.IStartupFilter>>(System.IServiceProvider provider) Line 28 C# Symbols loaded.
Microsoft.AspNetCore.Hosting.dll!Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() Line 181 C# Symbols loaded.
Microsoft.AspNetCore.Hosting.dll!Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() Line 182 C# Symbols loaded.
nemonic.Server.dll!nemonic.Server.Program.BuildWebHost(string[] args) Line 21 C# Symbols loaded.
nemonic.Server.dll!nemonic.Server.Program.Main(string[] args) Line 17 C# Symbols loaded.
This exception is expected and handled.
System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly has throwOnFileNotFound argument, and it achieves the non-throwing behavior by catching the file not found exceptions thrown internally.
https://github.com/dotnet/corefx/issues/19928 has a long discussion about exceptions thrown and caught as part regular program flow that is related to this.
Thanks! I will follow up dotnet/corefx#19928 from now on.
I am also getting this error after upgraded to core 2.1.4 and I do not understand from dotnet/corefx#19928
what to do to make my app start.
@ibocon , can you please help us by telling how you managed to get over this error?
I want to emphasize that even if I create a new project with dotnet core and Angular, after I
npm install npm-check-updates -g
ncu -u
npm install
I get this error and I am not able to start my app
I am not able to start my app
If you are not able to start your app, you may be hitting a different issue.
This issue was about System.IO.FileNotFoundException messages showing in a debug panel. However, the application run well without stopping or malfunctioning.
I am getting this with both my old projects after migrating to angular 6 and if I create a new one.

This is a blank project. I will upload it to github and share the repository.
It can't be reflection since I do not use it for now in this new project.
In StackTrace property of the exception I only have:
 | StackTrace | " at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)" | string
I wrote about my old project on stackoverflow at:
The new project repository can be found at
https://github.com/dobrinsky/Marksal-open.git
I am stuck at this point for a week almost and it is becoming really hard to understand why I am getting this error. Any help would be so huge please.
@dobrinsky many different exceptions are expected and noncrashing. This is one of them. See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-2.1 to capture startup errors. Also notice the "Server exception handling" section
I have the same problem.
File not found error: "Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer.resources"
Even if I do not use the freaking dll. No solution found.
â–¶ | $exception | {System.IO.FileNotFoundException: Could not load the specified file. File name: 'Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer.resources' at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)} | System.IO.FileNotFoundException
me too
{System.IO.FileNotFoundException: Could not load the specified file.
File name: 'Microsoft.AspNetCore.DataProtection.resources'
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)}
in the debug window.more than one *.resources file not found.
Hello everyone,
As @jkotas has pointed, this exception is handled. It occurs, but it is for sure not your problem. It is a false-positive. I also thought it was this, but it was not.
In my case, I upgraded from Angular 5 to Angular 6 and there were errors in the typescript code that were not shown anywhere:
For some reason, Angular didn't told anything about some compilation errors. Visual Studio didn't show any errors and there were no errors in the browser's console and there were no errors in Output -> ASP.NET Core Web server (though sometimes they appear).
I created the project from scratch and actually adding one element at a time:
create new class and paste the old code
create new typescript file and past the old code
At some point the project wouldn't load so it was obvious it was something wrong with my code in that file. In my case, the file was an Angular service. There was no indication of it being an error, but in some services, there was this import:
import 'rxjs/add/operator/map';
I know that map is not used anymore, but I think that this should be shown as an error in the compilation.
After removing this line and others in the other services, it worked.
I believed it was a C# because it was the only indication of an error that I got in the whole project.
Now, I do not know if you are using Angular or not. It doesn't matter because there is for sure an error that is there, but the compiler of the framework you are using doesn't catch it.
Hope this helps...
Hello there,
I bumped into this issue once I've turned off the 'Enable Just My Code' option in Options -> Debugging. And, when I switched on this option, exception gone.
Maybe there is something with inability to load symbols or something? (just assumption)
Most helpful comment
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.