“错误 MSB4057 缺少目标包"构建 .netstandard nuget 包时 [英] "Error MSB4057 missing target pack" when building .netstandard nuget package

查看:34
本文介绍了“错误 MSB4057 缺少目标包"构建 .netstandard nuget 包时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照 创建一个 .netstandard nuget 包这些说明,使用 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:项目中不存在目标pack".

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?

推荐答案

感谢 MSDN 论坛 我能够得到它工作.

Thanks to an answer on the MSDN forums I was able to get it working.

您必须在构建命令中指定您的 .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:UsersAdministratorDocumentsvisual studio 2017ProjectsAppLoggerAppLoggerAppLogger.csproj"/t:pack/p:Configuration=Release

msbuild "C:UsersAdministratorDocumentsvisual studio 2017ProjectsAppLoggerAppLoggerAppLogger.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆