尝试使用带有Update 3的Visual Studio 15 Enterprise在ASP.NET Core项目中添加Controller时,出现以下错误:
"The was an error running the selected code generator: No executables found matching command 'dotnet-aspnet-codegenerator'"
我使用Visual Studio 2017创建了一个新的asp.net core 2.0 mvc Web应用程序.
它引用了NuGet包"Microsoft.VisualStudio.Web.CodeGeneration.Design"(2.0.0),如果我想能够支持视图/控制器,它似乎是必需的.(我需要的功能)
当我发布我的网络应用程序时,我不希望看到发布到我的输出文件夹的开发依赖项(似乎是)...然而,我有一堆诸如
Microsoft.VisualStudio.Web.CodeGeneration.dll, Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll, Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll
等等
难道我做错了什么?:我怎样才能减少所有这些额外的dll?有一个(Microsoft.CodeAnalysis.Workspaces.dll),大约2Mb!
我从这里在ubuntu上安装了.NET Core 2.1.105
并创建了示例web api项目dotnet new api-test
然后我尝试添加dotnet观察程序包
dotnet add package Microsoft.DotNet.Watcher.Tools
Run Code Online (Sandbox Code Playgroud)
当我发出一个时,dotnet restore我收到以下错误:
$ dotnet restore
Restoring packages for ~/devel/apps/dotnet/api_test/api_test.csproj...
Restore completed in 101.8 ms for ~/devel/apps/dotnet/api_test/api_test.csproj.
~/devel/apps/dotnet/api_test/api_test.csproj : error NU1605: Detected package downgrade: Microsoft.NETCore.App from 2.0.6 to 2.0.0. Reference the package directly from the project to select a different version.
~/devel/apps/dotnet/api_test/api_test.csproj : error NU1605: api_test -> Microsoft.DotNet.Watcher.Tools 2.0.1 -> Microsoft.NETCore.App (>= 2.0.6)
~/devel/apps/dotnet/api_test/api_test.csproj : error NU1605: api_test -> Microsoft.NETCore.App (>= 2.0.0)
Restore failed …Run Code Online (Sandbox Code Playgroud)