Skip to content
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 not found #19

Open
Pawan1718 opened this issue Feb 8, 2024 · 16 comments
Open

Blazor Web App Template not found #19

Pawan1718 opened this issue Feb 8, 2024 · 16 comments
Labels
area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested. stale Issue is stale. Waiting on answer. tutorial-blazor Blazor tutorial issues

Comments

@Pawan1718
Copy link

Problem encountered on https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create
Operating System: windows

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

Blazor Web App Template not found in Visual Studio 2022

@steveharter steveharter added the area-tutorials Issues related to getting started tutorials label Feb 9, 2024
@mairaw
Copy link
Contributor

mairaw commented Feb 10, 2024

Can you confirm which version of Visual Studio 2022 do you have? It needs to be 17.8.0 or later.

@mairaw mairaw added the needs-more-info Not enough information has been provided. Please share more detail as requested. label Feb 10, 2024
@mairaw mairaw transferred this issue from dotnet/core Feb 13, 2024
@mairaw mairaw added the tutorial-blazor Blazor tutorial issues label Feb 13, 2024
Copy link

This issue is stale because there has been no response to a request for more information for 7 days.

@github-actions github-actions bot added the stale Issue is stale. Waiting on answer. label Feb 20, 2024
@mairaw mairaw removed the stale Issue is stale. Waiting on answer. label Mar 4, 2024
@masteroleary
Copy link

Same

@mairaw
Copy link
Contributor

mairaw commented Mar 7, 2024

@masteroleary what version of VS you're using?

@masteroleary
Copy link

masteroleary commented Mar 7, 2024

17.9.2

@masteroleary
Copy link

Microsoft Visual Studio Community 2022
Version 17.9.2
VisualStudio.17.Release/17.9.2+34622.214
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools 17.9.197.37128
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.9.197.37128
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.9.197.37128
Azure Functions and Web Jobs Tools

C# Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Extensibility Message Bus 1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub Copilot 1.156.0.0 (v1.156.0.0@82fafb995)
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

GitHub Copilot Agent 1.156.0

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.9.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.9.2.2412004+684740676513b3b208d5bd5b7f8786dab8d287b7
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.9.51.1
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.30103.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.9.0-3.24121.1+a98c90d56455379836dd5c845b35fa932b00cfa3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.9.0-beta.23614.3+a521e1cd420beb56c15faf6836184fadd2b7937a
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin 17.9.0.138 (d17-9@60c2b9b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.9.3.0 (remotes/origin/d17-9@f174974f91)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: d9a6e87
Java.Interop: xamarin/java.interop@149d70fe
SQLite: xamarin/sqlite@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools@ca1552d

@mairaw
Copy link
Contributor

mairaw commented Mar 7, 2024

@masteroleary Ok, so your VS version is fine. Can you open a command prompt window and tell us what dotnet --info returns?

/cc @danroth27

@masteroleary
Copy link

$ dotnet --info
.NET SDK:
Version: 8.0.200
Commit: 438cab6a9d
Workload version: 8.0.200-manifests.91505830

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-arm64
Base Path: C:\Program Files\dotnet\sdk\8.0.200\

.NET workloads installed:
[wasm-tools-net7]
Installation Source: VS 17.9.34622.214
Manifest Version: 8.0.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net7\8.0.2\WorkloadManifest.json
Install Type: Msi

[wasm-tools-net6]
Installation Source: VS 17.9.34622.214
Manifest Version: 8.0.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net6\8.0.2\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: VS 17.9.34622.214
Manifest Version: 8.0.6/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.6\WorkloadManifest.json
Install Type: Msi

[wasm-tools]
Installation Source: VS 17.9.34622.214
Manifest Version: 8.0.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.2\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: VS 17.9.34622.214
Manifest Version: 17.2.8004/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8004\WorkloadManifest.json
Install Type: Msi

[android]
Installation Source: VS 17.9.34622.214
Manifest Version: 34.0.52/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.52\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: VS 17.9.34622.214
Manifest Version: 17.2.8004/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8004\WorkloadManifest.json
Install Type: Msi

Host:
Version: 8.0.2
Architecture: arm64
Commit: 1381d5ebd2

.NET SDKs installed:
7.0.402 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]
8.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x64 [C:\Program Files\dotnet\x64]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

dev@PARALLELSM2 E:
$

@mairaw
Copy link
Contributor

mairaw commented Mar 7, 2024

@masteroleary thanks for the information so far. it seems you're running this on Parallels on a mac, correct?
I wonder if in your case it might be an issue with the PATH. Can you check what where.exe dotnet returns?
Maybe you need to change the order like I show at dotnet/core#5962 (comment)

I'd also try the CLI version to see if there's a mismatch between what you're running on the terminal and VS.
Can you run the command from https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-cli-tutorial/create just fine?

@masteroleary
Copy link

masteroleary commented Mar 7, 2024

Yes, Parallels on Mac

where.exe dotnet
C:\Program Files\dotnet\dotnet.exe

$ dotnet new blazor -o BlazorApp
The template "Blazor Web App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/8.0-third-party-notices for details.

Processing post-creation actions...
Restoring E:\BlazorApp\BlazorApp.csproj:
Determining projects to restore...
Restored E:\BlazorApp\BlazorApp.csproj (in 35 ms).
Restore succeeded.

Screenshot 2024-03-07 at 7 30 13 AM Screenshot 2024-03-07 at 7 30 23 AM

@mairaw
Copy link
Contributor

mairaw commented Mar 8, 2024

@masteroleary I checked with the team and they recommended you turn tracing on

Open a developer command prompt and set the following environment variables
SET VS_WTE_DIAGNOSTIC_MODE=File
SET VS_WTE_DIAGNOSTIC_VERBOSITY=2
SET VS_WTE_DIAGNOSTIC_TRACESWITCHES=ALL
SET VS_WTE_DIAGNOSTIC_OUTPUTFILE=%temp%\wte.log
2. Launch VS from the prompt using devenv.exe
3. Do File/New Project so you'll go through the new project dialog
4. Send us the log from %temp%\wte.logor share it, but scrub things like user names from the path

Tracing will log how the template engine is resolving .NET templates, including those coming from optional workloads.

@masteroleary
Copy link

[03-08-2024 01:52:15.45614] [Trace] SHAREDTRACING: Settings Manager -- global -- BEGIN: Settings Manager Configuration File
[03-08-2024 01:52:15.46114] [Trace] SHAREDTRACING: Settings Manager -- global -- END: Settings Manager Configuration File
[03-08-2024 01:52:15.50699] [Trace] SHAREDTRACING: DotNetOptionalSdkTemplateProvider -- OnGetAllTemplatePackagePathsAsync -- Finding sdk version for 17.9
[03-08-2024 01:52:15.51262] [Trace] SHAREDTRACING: DotNetOptionalSdkTemplateProvider -- OnGetAllTemplatePackagePathsAsync -- sdk version: 8.0.200, dotnet root path: C:\Program Files\dotnet\x64
[03-08-2024 01:52:15.54459] [Trace] SHAREDTRACING: DotNetOptionalSdkTemplateProvider -- OnGetAllTemplatePackagePathsAsync -- template packages:
[03-08-2024 01:52:15.55409] [Trace] SHAREDTRACING: AggregateTemplatePackageProvider.FinalizePackages -- -- Templates to install: C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.common.itemtemplates.7.0.306.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.common.projecttemplates.7.0.7.0.306.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.test.projecttemplates.7.0.1.1.0-rc.23213.1.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.web.itemtemplates.7.0.7.0.9.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.web.projecttemplates.7.0.7.0.9.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.web.spa.projecttemplates.7.0.7.0.9.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.winforms.projecttemplates.7.0.9-servicing.23321.6.nupkg,C:\Program Files\dotnet\x64\templates\7.0.9\microsoft.dotnet.wpf.projecttemplates.7.0.9-servicing.23321.9.nupkg,c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\web tools\azure\templates\Microsoft.Azure.WebJobs.CSharp.17.9.2.nupkg,c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\web tools\azure\templates\Microsoft.Azure.WebJobs.VisualBasic.17.9.2.nupkg,c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\web tools\azure\templates\Microsoft.WebTools.Http.Template.17.9.2.nupkg,c:\program files\microsoft visual studio\2022\community\common7\ide\extensions\microsoft\templateengine\Microsoft.VisualStudio.TemplateEngine.FallbackHostData.17.9.197.nupkg
[03-08-2024 01:52:15.56011] [Trace] SHAREDTRACING: TemplateProviderBase.OnGetContentETagAsync -- .NET Core Item Template Provider -- returned: c5d2a47b3d517b83099dfba7aa136c42e6990422e399f8f7d7871f12fac96394
[03-08-2024 01:52:15.56011] [Trace] SHAREDTRACING: TemplateProviderBase.OnGetContentETagAsync -- .NET Core Template Provider -- returned: c5d2a47b3d517b83099dfba7aa136c42e6990422e399f8f7d7871f12fac96394

@joeloff
Copy link
Member

joeloff commented Mar 9, 2024

VS is picking up the templates from Program Files\dotnet\x64. That is used by the x64 copy of dotnet on arm64 machines, and it's picking up older 7.0.9 templates from there.

Are you running an x64 copy of Visual Studio on arm64 Windows?

@masteroleary
Copy link

masteroleary commented Mar 9, 2024

VS is picking up the templates from Program Files\dotnet\x64. That is used by the x64 copy of dotnet on arm64 machines, and it's picking up older 7.0.9 templates from there.

Are you running an x64 copy of Visual Studio on arm64 Windows?

Yes, you are right! I deleted the x64 versions and restarted. Now the template appears in visual studio. Thank you @joeloff and @mairaw so much!

@joeloff
Copy link
Member

joeloff commented Mar 9, 2024

Awesome, happy to help.

@mairaw
Copy link
Contributor

mairaw commented Mar 9, 2024

Thanks @joeloff for taking us to the finish line!

@Pawan1718 the original issue is from you and your case is probably different than @masteroleary. So please let us know if you can confirm which version of VS you're running.

@mairaw mairaw added the stale Issue is stale. Waiting on answer. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested. stale Issue is stale. Waiting on answer. tutorial-blazor Blazor tutorial issues
Projects
None yet
Development

No branches or pull requests

5 participants