No executables found matching command 'dotnet-aspnet-codegenerator'"

后端 未结 13 2313
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 02:16

When trying to add a Controller in an ASP.NET Core project using Visual Studio 15 Enterprise with Update 3, I get the error below:

\"The was an error running

13条回答
  •  被撕碎了的回忆
    2020-12-15 02:55

    Add the following to your project.json:

    Under dependencies:

    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
        "version": "1.0.0-preview2-final",
        "type": "build"
    }
    

    Under tools:

    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
        "version": "1.0.0-preview2-final",
        "imports": [
            "portable-net45+win8"
        ]
    }
    
    • Version number may change depending on which version of .NET Core you're using in your project
    • You may get another error about Microsoft.DotNet.InternalAbstractions missing, in which case you'll need to get from NuGet
    • Make sure "Microsoft.VisualStudio.Web.CodeGeneration.Tools" version in dependencies matches "Microsoft.VisualStudio.Web.CodeGeneration.Tools" version in tools

提交回复
热议问题