Microsoft.AspNetCore.Hosting throws Startup assembly StartupBootstrapper failed to execute

See original GitHub issue

I see these errors logged on Azure (App Service) on every restart of the App Service:

Main message:

Startup assembly StartupBootstrapper failed to execute. See the inner exception for more details. Could not load file or assembly 'StartupBootstrapper, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. 

Stack trace:

System.InvalidOperationException:
System.IO.FileNotFoundException:
   at System.Reflection.RuntimeAssembly.nLoad (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Reflection.Assembly.Load (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Reflection.Assembly.Load (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.ExecuteHostingStartups (Microsoft.AspNetCore.Hosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)

Let me know what additional data I can collect for you that may help in fixing this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:22
  • Comments:58 (31 by maintainers)

github_iconTop GitHub Comments

30reactions
LawrenceSmith1437commented, Dec 10, 2019

Note, this is reproducible in Core 3.1.

9reactions
flatprojectcommented, Jan 26, 2020

I have fixed the

"Startup assembly StartupBootstrapper failed to execute. See the inner exception for more details. Could not load file or assembly ‘StartupBootstrapper, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified. "

by uninstalling the Azure web app AI site extension as suggested here.

I have also fixed the

"Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute. See the inner exception for more details. Could not load file or assembly ‘Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified. "

by installing "<PackageReference Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="3.1.0" />"

Also applied the advice from https://github.com/dotnet/aspnetcore/issues/15381#issuecomment-566777363 but not sure if it helped.

Now the only issue i get is

"Startup assembly DiagnosticServices.HostingStartup failed to execute. See the inner exception for more details. Could not load file or assembly ‘DiagnosticServices.HostingStartup, Culture=neutral, PublicKeyToken=null’. The system cannot find the file specified. "

which i can only fix by following the advice from https://github.com/dotnet/aspnetcore/issues/17370#issuecomment-567543883 which disables the profile and snapshot feature.

Is it possible to have profile and snapshot features working without getting the " DiagnosticServices.HostingStartup failed to execute" exception message?

I’m using framework dependant deployment from within visual studio publish screen and the app is .net core 3.1.0 64bit

Read more comments on GitHub >

github_iconTop Results From Across the Web

Startup assembly StartupBootstrapper failed to execute
Im getting this error in my logs currently: 2018-04-23 18:10:25.818 +00:00 [Fatal] Hosting startup assembly exception System.
Read more >
azure - Startup assembly Microsoft.ApplicationInsights. ...
Startup assembly Microsoft.ApplicationInsights.StartupBootstrapper failed to execute. See the inner exception for more details.
Read more >
Troubleshoot ASP.NET Core on Azure App Service and IIS
The ASP.NET Core Module attempts to start the worker process but it fails to start. The cause of a process startup failure can...
Read more >
Use hosting startup assemblies in ASP.NET Core
An IHostingStartup (hosting startup) implementation adds enhancements to an app at startup from an external assembly.
Read more >
ASP.NET Core 3.1.0 site won't run - Could not load ...
I'm building an ASP.NET Core app, and it's stored on an Azure web service. ... According to the logs, the error is in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found