“错误MSB4057缺少目标包";建立.netstandard nuget包时 [英] "Error MSB4057 missing target pack" when building .netstandard nuget package
问题描述
我正在尝试按照这些说明,使用VS2017 RC.它构建良好,但是当我尝试使用
I'm trying to create a .netstandard nuget package following these instructions, using VS2017 RC. It builds fine, but when I try to create the package using
msbuild /t:pack /p:Configuration=Release
我得到一个错误,目标 pack 在我的解决方案中不可用:
I get an error, that the target pack is not available in my solution:
错误MSB4057:项目中不存在目标包装".
error MSB4057: The target "pack" does not exist in the project.
我不太确定如何处理此消息或应该在哪里修复它.有什么建议吗?
I'm not really sure what to do with this message or where I should be looking to fix it. Any suggestions?
推荐答案
Thanks to an answer on the MSDN forums I was able to get it working.
您必须在build命令中指定.csproj,这样它才不会尝试使用解决方案文件(.sln).
You'll have to specify your .csproj in the build command so it won't try to use the solution file (.sln).
msbuild"C:\ Users \ Administrator \ Documents \ visual studio 2017 \ Projects \ AppLogger \ AppLogger \ AppLogger.csproj"/t:pack/p:Configuration = Release
msbuild "C:\Users\Administrator\Documents\visual studio 2017\Projects\AppLogger\AppLogger\AppLogger.csproj" /t:pack /p:Configuration=Release
此外,我还必须从NuGet安装NuGet.Build.Tasks.Pack"软件包.
Additionally I had to install the NuGet.Build.Tasks.Pack" package from NuGet.
这篇关于“错误MSB4057缺少目标包";建立.netstandard nuget包时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!