gpt4 book ai didi

visual-studio-2015 - 缺少脚手架 ASP.Net Core

转载 作者:行者123 更新时间:2023-12-04 06:33:00 26 4
gpt4 key购买 nike

传统上,Visual Studio 中曾经有脚手架来加速添加 Controller 、区域、 View 等。 在我安装 ASP.NET Core 后,我注意到所有这些都消失了,这太可怕了(尤其是当你想添加一个新的区域,手动完成这项工作会导致颈部疼痛)。

有什么办法可以把它们带回来吗?为什么微软团队会做出如此糟糕的决定?

enter image description here

最佳答案

Is there any possible way to bring them back?



您需要添加必要的包:
  • Microsoft.VisualStudio.Web.CodeGeneration.Tools
  • Microsoft.VisualStudio.Web.CodeGenerators.Mvc

  • 这是一个示例 project.json 文件:
    {
    "dependencies": {
    "Microsoft.NETCore.App": {
    "version": "1.0.1",
    "type": "platform"
    },
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Hosting": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
    "version": "1.0.0-preview2-final",
    "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
    "version": "1.0.0-preview2-final",
    "type": "build"
    }
    },
    "tools": {
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
    "version": "1.0.0-preview2-final",
    "imports": [
    "portable-net45+win8"
    ]
    }
    },
    "frameworks": {
    "netcoreapp1.0": {
    "imports": [
    "dotnet5.6",
    "portable-net45+win8"
    ]
    }
    }
    }

    添加这些包后,您将可以访问脚手架。

    enter image description here

    作为引用,上面的屏幕截图来自 Visual Studio 2015 Update 3,具有以下相关扩展:
  • Microsoft .NET Core 工具
  • Microsoft ASP.NET 和 Web 工具
  • Microsoft ASP.NET Web 框架和工具
  • 关于visual-studio-2015 - 缺少脚手架 ASP.Net Core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39938246/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com