dotnet / dotnet/aspnetcore

ASP.NET Core Logging Integration version 7.0.7 on Azure but running on .NET 6

Open
#48,898 1 comment 0 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

I run a .NET6 Web API on an Azure App Service. Configured as .NET 6 (LTS).

Through the Azure App Service Console I get:

```
dotnet --version
7.0.203
```

I'm running into an error message in the Eventlog.xml of my Azure App Service telling:

```

Application: w3wp.exe CoreCLR Version: 6.0.1623.17311 .NET Version: 6.0.16 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Logging.AzureAppServices, Version=6.0.16.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. File name: 'Microsoft.Extensions.Logging.AzureAppServices, Version=6.0.16.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.HostingStartupWebHostBuilder.<>c__DisplayClass6_0.b__0(WebHostBuilderContext context, IServiceCollection services) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<.ctor>b__6_2(HostBuilderContext context, IServiceCollection services) at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build()
<....>

```

I got this package in my .NET 6 Web API csproj declared:

```

```

### Expected Behavior

I'm wondering why the process is requesting version 6.0.16.0 from the AzureAppServices package while I'm explicitly having 6.0.9 declared and published.

Is this because the App Service has a Site Extension "ASP.NET Core Logging Integration version 7.0.7"?

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

Application: .NET 6 - App Service: .NET 7

### Anything else?

_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.