[WebToolsE2E][Aspire] After adding any component, an error occurs "The type or namespace name 'App' could not be found".
REGRESSION INFO: Repro on Aspire 8.0.0 preview 3
INSTALL STEPS
- Clean machine: Win11 x64 23h2 ENU
- Install VS Code[1.86.2]
- Install C# Dev Kit[1.3.10]
- Install SDK 8.0.202
- Install Aspire.ProjectTemplates.8.0.0-preview.4.24122.7
- Apply NuGet Feeds
REPRO STEPS
-
Open VS Code, Create a new .NET Aspire Application
- 'Ctrl-Shift-P' > .NET: New Project > .NET Aspire Application
- Create new folder "aspire" under the home folder (C:\Users<user-name>) and select that folder as the solution folder
- Name the new project
-
'Ctrl-Shift-P' to add a new Blazor Web App project under this solution > give a name 'BlazorApp1'
-
Right-click the xxx.AppHost > Add project reference to BlazorApp1
-
Open Program.cs under xxx.AppHost, add following code 'builder.AddProject<Projects.BlazorApp1>("BlazorApp1");'
-
Right-click the xxx.Web project > Open in Integrated Terminal > add aspire component
- dotnet add package Aspire.Azure.Storage.Queues --version 8.0.0-preview.4.24122.7
-
Build and open Program.cs under BlazorApp1
ACTUAL
An error occurs "The type or namespace name 'App' could not be found"
EXPECTED There won't be any errors.
Doesn't look aspire related.
Transferring to dotnet/aspnetcore, since this is Blazor related.
Is this just an error that shows up in the editor? Or does this prevent you from running the project? Either way, we think this is probably a razor-compiler issue.
This is just an error that shows up in the editor, the project can run successfully.
@dotnet/razor-tooling Given that compilation succeeds, I assume this is a tooling error.
We've had a couple of instances of the class for a component not being recognized until the .razor/.cshtml file is opened.
Was able to reproduce with
C# DevKit: v1.4.29
C#: v2.22.5
Only happens on project add. Reload of vs code gets rid of the issue
This should be resolved with v2.39.28 (pre-release)