【发布时间】:2019-09-27 16:17:34
【问题描述】:
我试图弄清楚如何在构建时或特别是在打包时指定 packageId。我的 csproj 中有以下内容,可以很好地在本地创建包以进行测试。我们正在使用 Azure DevOps 构建管道来构建和打包我们的 nuget 包,我希望能够将 packageId 设置为构建管道中的任务或 msbuild 参数。
有人对我如何实现这一点有建议吗?
谢谢,
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);Dependencies</TargetsForTfmSpecificBuildOutput>
<Version>0.1.0.5</Version>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>MyAssembly</AssemblyName>
<RootNamespace>MyAssembly</RootNamespace>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<PackageId>MyAssembly.Test</PackageId> <----- set at package time
<FileVersion>1.0.0.0</FileVersion>
<PackageLicenseUrl>https://my.domain.xyz/license.pdf</PackageLicenseUrl>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<Description>A useful description.</Description>
<Company>XYZ</Company>
<Authors>UiPath</Authors>
<PackageIconUrl>http://my.domain.xyz/favicon.ico</PackageIconUrl>
【问题讨论】:
标签: msbuild azure-devops nuget-package