NuGet:pack 命令不包括 nuget 依赖项 [英] NuGet: pack command is NOT including nuget dependencies

查看:31
本文介绍了NuGet:pack 命令不包括 nuget 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:

  • nuget.exe 版本:1.6.21205.9031
  • 项目 A.csproj 打包到 A.1.0.0.0.nupkg 中,并发布到托管在我的本地 IIS 上的 LOCAL 包存储库(我的 VS Nuget 扩展我能够将 A 包添加到新项目中)
  • Project B.csproj 依赖于我使用 VS Nuget 扩展添加的 A 包

现在,当我跑步时

nuget spec

B.nuspec 已创建.

the B.nuspec is created.

然后我跑

nuget pack B.csproj -verbose

但是在创建的 B 包中,它们对 A 包没有依赖性.nuget pack 命令告诉我它已找到 packages.config 文件(其中包含对 A 包的依赖项),但随后显示依赖项:无".

but in the created B-package, their is NO dependency to the A-package. The nuget pack command tells me that it has found the packages.config file (which contains the dependency to the A-package), but then it says "Dependencies: None".

我错过了什么?问题可能是只能在我的本地包存储库中找到 A 包吗?如何让 nuget.exe 知道这个本地存储库?

What am i missing? Could the problem be that the A-package can only be found in my local package repository? How can i make nuget.exe aware of this local repository?

非常感谢!

推荐答案

nuget pack 需要能够找到 packages 文件夹才能解决依赖关系(参见 http://nuget.codeplex.com/workitem/3097),或者在与 .csproj 相同的文件夹中(只要因为有一个 .sln 文件在其上一级)或在 NuGet.Config 中指定的文件夹中.

nuget pack needs to be able to find the packages folder in order to resolve dependencies (see http://nuget.codeplex.com/workitem/3097), either in the same folder as the .csproj (as long as there's a .sln file one level above it) or in a folder specified in NuGet.Config.

这篇关于NuGet:pack 命令不包括 nuget 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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