【问题标题】:How to add tool section in .net core 1.1 csproj如何在 .net core 1.1 csproj 中添加工具部分
【发布时间】:2017-08-06 13:43:48
【问题描述】:

“dotnet bundle”命令以代码 1 退出

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

我怀疑这个问题与 VS 2017 的 cs.proj 文件中缺少的工具部分有关。

"tools": {
    "BundlerMinifier.Core": "2.2.281"

在 VS 2015 中,它曾经按照上面的链接完成。 No executable found matching command "dotnet-bundle" during WebDeploy for ASP.NET Core

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

【问题讨论】:

    标签: c# asp.net visual-studio-2017 asp.net-core-1.1


    【解决方案1】:

    project.json to csproj mapping docs 是你的朋友!以下是tools 部分的映射方式:

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

    变成

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

    【讨论】:

    • 非常感谢,它成功了。但是我遇到了另一个与凉亭有关的问题。 ,这给出了错误,答案中建议的类似更改对它不起作用。
    【解决方案2】:

    当您查看 .csproj 文件时,它的结构应该是相当明显的。但只是以防万一。

    <Project>
        ...Other stuff here    
    
        <ItemGroup>
          <DotNetCliToolReference Include="Your.Package.Name.Here" Version="x.x.x" />
        </ItemGroup>
    
        ...Other stuff here
    </Project>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-06
      • 2017-03-20
      • 2017-08-30
      • 2017-07-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多