dotnet / dotnet/aspnetcore

Could not load file or assembly 'Microsoft.Extensions.Logging.AzureAppServices'

Open
#50,389 5 comments 0 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Description

I think I'm running into the same bug as https://github.com/dotnet/extensions/issues/2566

When starting my app on Azure App Service, I get this stack trace:
```
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Logging.AzureAppServices, Version=6.0.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.Extensions.Logging.AzureAppServices, Version=6.0.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.AspNetCore.Hosting.AppServicesWebHostBuilderExtensions.<>c.b__0_0(ILoggingBuilder builder)
at Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services, Action`1 configure)
at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass8_0.b__0(IServiceCollection collection)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.<>c__DisplayClass10_0.b__0(WebHostBuilderContext _, IServiceCollection services)
at System.Action`2.Invoke(T1 arg1, T2 arg2)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at .Serpentine.Program.RunAsync(String[] args) in \Serpentine\Program.cs:line 14
at .Serpentine.Program.Main(String[] args) in \\Serpentine\Program.cs:line 9
at .Serpentine.Program.(String[] args)
```

### Reproduction Steps

1. Publish app from Visual Studio
2. Try to run on Azure App Service

### Expected behavior

Doesn't crash

### Actual behavior

Crashes

### Regression?

Yes. I think this is related to which versions of .NET/ASP.NET are supported, similar to https://github.com/dotnet/extensions/issues/2566#issuecomment-622480085

### Known Workarounds

_No response_

### Configuration

```

net6.0


all
runtime; build; native; contentfiles; analyzers; buildtransitive



all
runtime; build; native; contentfiles; analyzers; buildtransitive











all
runtime; build; native; contentfiles; analyzers; buildtransitive






all
runtime; build; native; contentfiles; analyzers; buildtransitive






all
runtime; build; native; contentfiles; analyzers; buildtransitive

```

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.