简体   繁体   English

修复nuspec文件中的错字后,nuget“无法解决依赖项”

[英]nuget “Unable to resolve dependency” after fixing typo in nuspec file

I have two Visual Studio (2010) solutions. 我有两个Visual Studio(2010)解决方案。 One solution, SolutionAlpha, has two projects, ProjA and ProjB, both of which have nuspec files, both of which have package build enabled, and for both of which a nupkg file is generated. 一种解决方案,SolutionAlpha,有两个项目ProjA和ProjB,两个项目都有nuspec文件,这两个文件都启用了程序包构建,并且为这两个文件生成了一个nupkg文件。 I added a dependency in the nuspec file for ProjB pointing to ProjA, but I accidentally had a bunch of spaces in the name, so it looked like: 我在nuspec文件中为ProjB指向ProjA添加了一个依赖项,但是我不小心在名称中有一堆空格,所以它看起来像:

<depedencies>
    <dependency>Pro      jA</depedency>
</dependencies>

I put both of the nupkg files for ProjA and ProjB in a directory, which Visual Studio is set up to use as a nuget repository. 我将ProjA和ProjB的两个nupkg文件都放在一个目录中,该目录已设置为Visual Studio用作nuget存储库。 In SolutionNumeric's Proj1, I tried to add a Nuget reference to ProjA and to ProjB, but I kept getting Unable to resolve dependency 'Pro jA . 在SolutionNumeric的Proj1中,我尝试添加对ProjA和ProjB的Nuget引用,但是我一直Unable to resolve dependency 'Pro jA

I corrected the nuspec file in ProjA, copied it to the directory, confirmed that it was correct using NuGet Package Explorer, and cleared the recent packages and package cache through Visual Studio, yet I still get the error. 我在ProjA中更正了nuspec文件,将其复制到目录中,使用NuGet软件包资源管理器确认它是正确的,并通过Visual Studio清除了最近的软件包和软件包缓存,但是仍然出现错误。

How can I resolve this? 我该如何解决?

Thanks! 谢谢!

edit: 编辑:

This works from a solution for which nuget has never been used. 这是从从未使用过nuget的解决方案开始的。

When I start the package manager console, I get Package Manager Console Host Version 2.0.30619.9119 . 启动程序包管理器控制台时,将获得Package Manager Console Host Version 2.0.30619.9119

Of course, after way too much time trying to figure this one out, and immediately after asking the question here, I figure out that the answer is to remove the related folders from the packages directory in my solution. 当然,在花了太多时间试图解决这个问题之后,在问完这里的问题后,我立即发现答案是从解决方案的packages目录中删除相关文件夹。 I had tried doing full-text searches of the solution directory for the bad name, or even just the part of the name after the spaces, but got nothing that I was able to make sense of. 我曾尝试对解决方案目录进行全文搜索,以查找错误名称,甚至只是名称后面的空格部分,但没有任何我能理解的含义。 It must have been in some binary file somewhere in packages. 它必须在软件包中某个二进制文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM