You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.NET Core中Vue.js模板已停用?重复操作报错咨询

解决.NET Core Vue模板找不到的问题

Hey there, let's break down what's happening here:

First off, your hunch is right—the old Microsoft.AspNetCore.SpaTemplates package has been officially retired and removed by Microsoft. That's why when you try to use the old install and creation steps now, you get the "no templates match" error. This legacy template set was deprecated a while back as Microsoft shifted to integrating SPA templates directly into the official .NET SDK ecosystem for better maintenance and compatibility.

Here's how to fix this and create your Vue + .NET project properly now:

  1. Clean up the outdated template package (if it's still lingering on your machine):
    dotnet new --uninstall Microsoft.AspNetCore.SpaTemplates::*
    
  2. Verify your .NET SDK version:
    Run this command to check what version you're running:
    dotnet --version
    
    You'll need .NET 6 or newer (LTS versions like .NET 6 or .NET 8 are highly recommended) because these SDKs include official, actively maintained SPA templates right out of the box. If your version is older, upgrade to the latest LTS SDK from Microsoft's official releases.
  3. Create your Vue + .NET project directly:
    Once you have a compatible SDK version, you can skip the old template install step entirely. Just run these familiar commands:
    mkdir new-project
    cd new-project
    dotnet new vue
    
    This will use the official, up-to-date Vue template integrated with the .NET SDK, which works seamlessly with modern Vue versions and receives regular updates.

Quick fallback tip:

If you still encounter a "no template found" error after upgrading your SDK, you can explicitly install the official SPA template package with this command (though this shouldn't be necessary for newer SDK versions):

dotnet new --install Microsoft.AspNetCore.Spa.ProjectTemplates::*

内容的提问来源于stack exchange,提问作者Xavier Peña

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:28:33