Skip to content

Issues with logging generator in recent runtime upgrade (.NET 6 preview) #34429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericbeaudry opened this issue Jul 16, 2021 · 2 comments
Closed
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly

Comments

@ericbeaudry
Copy link

Bug description

See also #34272
From a fresh AspNet hoted Blazor project running the latest preview bits
Call to endpoints.MapRazorPages() fails with:

System.TypeInitializationException: 'The type initializer for 'Microsoft.AspNetCore.Mvc.MvcCoreLoggerExtensions' threw an exception.'
Inner Exception:
MissingMethodException: Method not found: 'System.Action`4<Microsoft.Extensions.Logging.ILogger,!!0,!!1,System.Exception> Microsoft.Extensions.Logging.LoggerMessage.Define(Microsoft.Extensions.Logging.LogLevel, Microsoft.Extensions.Logging.EventId, System.String, Boolean)'.

To Reproduce

1- Create a new AspNet Hosted Blazor project
2- Update Client packages to (latest avail at the time)

  • Microsoft.AspNetCore.Components.WebAssembly Version="6.0.0-rc.1.21366.1"
    
  • Microsoft.AspNetCore.Components.WebAssembly.DevServer Version="6.0.0-rc.1.21366.1"
    

3- Update Server packages to (latest avail at the time)

  • Microsoft.AspNetCore.Components.WebAssembly.Server Version="6.0.0-preview.6.21355.2"
    
  • Microsoft.AspNetCore.Components.WebAssembly.Server Version="6.0.0-rc.1.21366.1"
    

4- Run
image

Further technical details

  • ASP.NET Core version : 6.0.0-preview.6.21355.2

  • Output of dotnet --info
    .NET SDK (reflecting any global.json):
    Version: 6.0.100-preview.6.21355.2
    Commit: 7f8e0d76c0

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.6.21355.2\

Host (useful for support):
Version: 6.0.0-preview.6.21352.12
Commit: 770d630b28

.NET SDKs installed:
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.301 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
6.0.100-preview.6.21355.2 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.6.21355.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.6.21352.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.6.21353.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

  • The IDE
    Microsoft Visual Studio Professional 2022 Preview
    Version 17.0.0 Preview 2.0
    VisualStudio.17.Preview/17.0.0-pre.2.0+31512.422
@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Jul 16, 2021
@pranavkm
Copy link
Contributor

pranavkm commented Jul 16, 2021

Microsoft.AspNetCore.Components.WebAssembly.Server Version="6.0.0-rc.1.21366.1"

I've no idea where you're picking up a rc.1 version of the package from, but preview.6 is the latest available version on nuget: https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Server/6.0.0-preview.6.21355.2.

I guess you're pointing to our nightly builds? I would recommend using the builds from nuget.org to avoid inconistencies.

@ericbeaudry
Copy link
Author

ericbeaudry commented Jul 16, 2021

Well, yes these packages are updated many times a day from what I can see.
I was directed to those packages to solve issues with blazor hot reload.
I'll give another try to the official nuget and post the results back here
So reverted all packages to 6.0.0-preview.6.21355.2 and the problem is solved.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly
Projects
None yet
Development

No branches or pull requests

3 participants