【发布时间】:2021-04-18 18:30:38
【问题描述】:
我正在尝试将 netstandard2.0 类库 nuget 部署到本地文件夹存储库(在 FolderProfile.pubxml 中指定)。这可以通过 VisualStudio 对项目的发布上下文操作正常工作:幕后进程根据 project.csproj 构建项目并打包所需的项目,然后根据 FolderProfile.pubxml 复制 nuget 包。我预计这也可以通过 msbuild 实现(用于脚本)。
msbuild /t:Publish /p:PublishProfile=FolderProfile.pubxml
这将构建项目并将 bin/Debug/netstandard2.0 的内容复制到本地文件夹存储库。不幸的是,这与所要求的不同,PublishProfile 指定 Release 配置,而 project.csproj 明确声明只打包 .dll(.deps.json 和 .pdb 都没有)
msbuild /t:Pack
根据项目.csproj打包nuget内容,但将包留在bin/Debug中。
可以通过/p:Configuration=Release 实现切换到发布,但这仍然不足以实现预期。
我创建了一个简单的演示项目,地址为https://github.com/JanCervak/NugetPublishDifferenceRepro, 本地文件夹存储库设置为 %TEMP%
使用 VS 2019 16.8.3
【问题讨论】:
标签: visual-studio msbuild nuget