在DOTNET和MSBuild的包之间的区别

问题描述 投票:0回答:1

我用VS2017的新SDK风格的项目

在DOTNET我可以包使用下面的命令:

      dotnet pack project.csproj     --no-dependencies  --no-restore --output c:\packages -p:TargetId=abc -p:configuration=release 

在MSBuild的,我可以用打包的命令:

     msbuild project.csproj /t:pack -p:TargetId=abc -p:configuration=release 

如何使用的MSBuild设置的dotnet --no-dependencies --no-restore --output的选项

c# .net .net-core msbuild
1个回答
3
投票
  • --no-restore并不需要翻译。如果你想恢复,通过-restore(简称-r)来的MSBuild。
  • --no-build转化为-p:NoBuild=true
  • --no-dependencies转化为-p:RestoreRecursive=false(注意,这并不真的需要与--no-restore一起使用)
  • --output转化为-p:PackageOutputPath=C:\some\path

请注意,其他的命令如build --no-dependencies翻译成不同的东西:-p:BuildProjectReferences=false不建项目到项目的引用,这可能是你想要的东西来代替。

从命令行参数的MSBuild参数的总映射数源文件遍布在DOTNET / CLI GitHub库:

你可以从两个命令行或项目文件中设置 - - 这是由目标的NuGet支持更多的参数在NuGet pack and restore as MSBuild targets被记录在案。

© www.soinside.com 2019 - 2024. All rights reserved.