question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On Azure AppServices, the following AzureAppServices exception is logged on startup

See original GitHub issue

Describe the bug

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.

To Reproduce

Deploy ASPNET Core 3.0 App to App Services

Expected behavior

Not throw an exception?

Additional context

This has been an upgrade from 2.2, potentially some config is not correct?

System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute. See the inner exception for more details.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly assemblyContext, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.ExecuteHostingStartups()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
shirhatticommented, May 1, 2020

For folks on this thread, I’m reposting @anurse’s comment on a duplicate thread as a workaround till we fix our site extension


I have a workaround you can try, since all the Site Extension does is configure a special logging component (which is already on NuGet):

  1. Add a package reference to Microsoft.AspNetCore.AzureAppServicesIntegration with the same major-minor version as ASP.NET Core (i.e. 3.0 or 3.1).

  2. Call .UseAzureAppServices on your IWebHostBuilder. If you are using WebHost (i.e. you have a call to WebHost.CreateDefaultBuilder() in your Program.cs, then just add it to that:

WebHost.CreateDefaultBuilder(args)
    .UseAzureAppServices(); // <-- Add this

If you are using generic host (recommended in 3.0+), then this goes in your ConfigureWebHostDefaults call:

Host.CreateDefaultBuilder(args)
    .ConfigureWebHostDefaults(webBuilder =>
    {
        webBuilder.UseStartup<Startup>()
            .UseAzureAppServices(); // <-- Add this
    });


1reaction
analogrelaycommented, May 7, 2020

Closing as this should be resolved in 3.1.4 (this is a duplicate of https://github.com/dotnet/aspnetcore/issues/20617).

3.1.4 should be releasing shortly. If that doesn’t resolve the issue, feel free to comment and/or open a new issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot ASP.NET Core on Azure App Service and IIS
In the Azure portal, open the app in App Services. Select Diagnose and solve problems. Select the Diagnostic Tools heading. Under Support Tools, ......
Read more >
c# - .net 5 logging to azure app service protocol stream not ...
To enable the logs, In Azure portal go to App service -> App Service Logs. Enable the Application Logging (Filesystem).
Read more >
Azure App Service — Troubleshooting HTTP Error 500.30
There is another option to see the exception, you have to open Diagnose and solve problems > Diagnostic Tools > Application Event Logs:....
Read more >
Microsoft.AspNetCore.AzureAppServices.HostingStartup ...
I am getting the following error in my logs when releasing to a testing ... InvalidOperationException: Startup assembly Microsoft.
Read more >
Where to Find Azure App Service Logs for Your App, IIS, ...
Review of the types of Azure App Service logs and how to access them. Find how to access app logs, IIS logs, event...
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