【发布时间】:2017-03-04 04:58:01
【问题描述】:
我正在尝试执行基于 .nuspec 文件构建 nuget 包的构建后事件。我正在使用 Visual Studio 2013。我的后期构建事件命令行是:
nuget pack $(ProjectPath) -Symbols -Properties Configuration=$(ConfigurationName) -IncludeReferencedProjects
当我构建我的项目时,我收到以下错误:
The command "nuget pack C:\Users\user\Documebts\Code\BookProject\BookProject.Nuget\
BookProject.Nuget.csproj -Symbols -Properties Configuration=Debug
-IncludeReferencedProjects" exited with code 1.
我不确定发生了什么 - 我将 Visual Studio 构建输出更改为诊断并发现:
>Using 'BookProject.nuspec' for metadata. (TaskId:44)
>Access to the path 'C:\BookProject.1.0.3.4.nupkg' is denied. (TaskId:44)
>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "nuget pack C:\Users\user\Documebts\Code\BookProject\BookProject.Nuget\ BookProject.Nuget.csproj -Symbols -Properties Configuration=Debug -IncludeReferencedProjects" exited with code 1.
>Done executing task "Exec" -- FAILED. (TaskId:44)
>Done building target "PostBuildEvent" in project "Miw.Mshdf.Net.Nuget.csproj" -- FAILED.: (TargetId:72)
如果我打开命令提示符并输入构建后事件命令,它可以正常工作并且构建 nuget 包没有任何问题。有什么想法吗?
【问题讨论】:
标签: asp.net visual-studio visual-studio-2013 nuget nuget-package