Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Microsoft.AspNetCore.AzureAppServices.HostingStartup problem #7172


User avatar
0
BobIngham created

6.8.0, angular, .net-core framework 4.6 I am getting the following error in my logs when releasing to a testing deployment slot in Azure (using publish method from Visual Studio for the .net core solution)

FATAL 2019-06-18 11:20:00,376 [1    ] soft.AspNetCore.Hosting.Internal.WebHost - Hosting startup assembly exception
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' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
   --- End of inner exception stack trace ---

The system appears to be working normally after this error is thrown but I don't like this kind of noise in my log. Does anyone have any ideas or pointers as to what may be causing the error and, more to the point, are there likely to be any repercussions when this testing deployment slot is swapped with staging and then swapped with production?


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    see: https://forum.aspnetboilerplate.com/viewtopic.php?p=28301

  • User Avatar
    0
    BobIngham created

    @maliming, thanks. I quote from the closed issue:

    For the Microsoft.AspNetCore.AzureAppServices.HostingStartup, I've applied the workaround explained here https://github.com/aspnet/Hosting/issues/1246 but I still have same exception

    I have read the github issue at Could not load file or assembly 'Microsoft.AspNetCore.AzureAppServices.HostingStartup' and it suggests I add Microsoft.AspNetCore.AzureAppServices.HostingStartup as a nuget package to the Web.Host project:

    Can I ask if anyone knows if this will cause issues with the Zero framework?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bobingham

    Is your app .NET Framework 4.6.1 or 4.6.2 ?

  • User Avatar
    0
    BobIngham created

    Hi @ismcagdas. 4.6.1

  • User Avatar
    0
    BobIngham created

    @ismcagdas. Error still occuring in logs on startup in Azure but system seems to work. It's just noise but I would like to reove asap.

  • User Avatar
    0
    maliming created
    Support Team

    I have not found a solution to prevent this error. However, it does not seem to affect the normal operation of the Zero application.