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
Blazor Web App template fails to compile when selecting Auto, Global #50980
Comments
This issue also repro when selecting |
Verify this bug was fixed on the latest .NET 8.0-rtm build. |
So cannot use 8 RC2? to trial blazor??? Have to wait for RTM version?? |
Hi @Alan-Steadman. This compilation error has an easy workaround: just copy the Error.razor file from the client project to the server project. |
Thanks - looks like I've got a similar-looking but different issue then: Create new "Blazor Web App" (called "ffs", Auth Type = none, Interactivity Type = Auto, Per Page/Component) Try to build... build fails saying (twice) "error CS0246: The type or namespace name 'ffs' could not be found (are you missing a using directive or an assembly reference?)". The two errors appear in the error list (program.cs, line 1, "using ffs.Client.Pages" and line 2 "using ffs.Components". When double clicking the errors, the program.cs file opens with red squiggles on those two lines, which promptly disappear after a few seconds, and disappear from the error list, but any attempt to build or run result in the same build error, but the errors don't then appear in the error list. I'm using VS 2022 17.7 with the option enabled to use previews of the .Net SDK, I've got .Net SDK 8 RC2 installed and I've restarted, and created three projects and all have the same issue. Should I log this as a new issue? |
@Alan-Steadman You need to use VS 2022 17.8 with .NET 8. While in some cases using 17.7 may work with .NET 8 projects, there are known incompatibilities. Please try the latest 17.8 preview and verify whether it resolves your issue. |
Thanks @danroth27, much appreciated. Yes, I've installed VS2022 17.8 Preview following these steps and it works. Many thanks for your help! |
Just used the Blazor Web App template with Visual Studio 17.8.0 Preview 7.0 and ASP.NET and Web Tools 17.8.350.26616 and had this problem. |
HI @peterhvogel. This issue is fixed for the upcoming .NET 8 release, but you can work around it with .NET 8 RC2 by moving Pages/Error.razor from the client project to the server project. See https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-2#known-issues for details. |
Did that! Thanks.
Yours truly,
Peter Vogel, MBA
My mama died and left me
My papa died and left me
I ain’t good looking, baby
But I’m somewhat sweet and kind
- “Statesboro Blues” by Blind Willie McTell
***@***.***
From: Daniel Roth ***@***.***>
Sent: Friday, November 10, 2023 5:32 PM
To: dotnet/aspnetcore ***@***.***>
Cc: Peter Vogel ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/aspnetcore] Blazor Web App template fails to compile when selecting Auto, Global (Issue #50980)
HI @peterhvogel<https://github.com/peterhvogel>. This issue is fixed for the upcoming .NET 8 release, but you can work around it with .NET 8 RC2 by moving Pages/Error.razor from the client project to the server project. See https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-2#known-issues for details.
—
Reply to this email directly, view it on GitHub<#50980 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJLG2LX22WMWBGN2ZIKAJ4TYD2TM5AVCNFSM6AAAAAA5KJZYSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGUZDAMJQGE>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Repro steps:
Expected result: App builds
Actual result:
C:\Users\user\source\repos\BlazorApp1Test\BlazorApp1Test.Client\Pages\Error.razor(28,33,28,44): error CS0246: The type or namespace name 'HttpContext' could not be found (are you missing a using directive or an assembly reference?)
The text was updated successfully, but these errors were encountered: