C# 如何在.net core 1.1 csproj中添加工具部分

C# 如何在.net core 1.1 csproj中添加工具部分,c#,asp.net,visual-studio-2017,asp.net-core-1.1,C#,Asp.net,Visual Studio 2017,Asp.net Core 1.1,命令“dotnet bundle”退出,代码为1 我在VS 2017中发布.net core 1.1应用程序时出现上述错误 "tools": { "BundlerMinifier.Core": "2.2.281" 我怀疑问题与VS 2017中cs.proj文件中缺失的工具部分有关 "tools": { "BundlerMinifier.Core": "2.2.281" 在VS 2015中,过去的做法与下面的链接相同。 如何在VS 2017的csproj文件中为.net co

命令“dotnet bundle”退出,代码为1

我在VS 2017中发布.net core 1.1应用程序时出现上述错误

"tools": {
    "BundlerMinifier.Core": "2.2.281"
我怀疑问题与VS 2017中cs.proj文件中缺失的工具部分有关

"tools": {
    "BundlerMinifier.Core": "2.2.281"
在VS 2015中,过去的做法与下面的链接相同。

如何在VS 2017的csproj文件中为.net core 1.1应用程序添加工具部分?

他们是您的朋友!以下是
工具
部分的映射方式:

{
  "tools": {
    "BundlerMinifier.Core": "2.2.281"
  }
}
变成

<ItemGroup>
  <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.281" />
</ItemGroup>

当您查看.csproj文件的结构时,应该会发现这一点。但以防万一

<Project>
    ...Other stuff here    

    <ItemGroup>
      <DotNetCliToolReference Include="Your.Package.Name.Here" Version="x.x.x" />
    </ItemGroup>

    ...Other stuff here
</Project>

……这里还有其他东西
……这里还有其他东西

非常感谢,它成功了。然而,我得到了另一个与鲍尔有关的问题,这是一个错误,答案中建议的类似更改对它不起作用。