为什么[Insert Nuget Package Here]不提取dll

时间:2016-04-15 21:33:38

标签: nuget nuget-package nuget-package-restore protobuf-csharp-port

所以我接受一些奇怪的事情发生在我的最后用缓存或其他东西。显然已经清空了缓存,删除了包文件夹和regot包。

https://www.nuget.org/packages/Google.ProtocolBuffers/

重新命名nupkg zip,查看并且dll在那里。它们只是被提取出来 - 说nuspec看起来对它的文件夹结构是错误的。但很难相信它只是我有这个问题。

我之前从未有过这种行为,并且已经沉入了大约2个小时。所以希望有人可以指出真正明显的,并解释为什么我过去使用过的包装突然变得笨拙。

编辑以获取更多信息: 我在vs2015企业中使用了4.6.1控制台项目(只是标准的.net而不是dnx或任何时髦的东西)。 刚试过4.5.2,我有同样的问题。没有引用添加到项目中的任何dll。而且在packages文件夹中没有dll - 尽管xml文件已经完成了。但是,如果我进入nupkg,重命名为.zip并打开我可以看到它们应该是的dll。我也经常运行vs作为管理员 - 包安装也从命令行失败(不是我预期的任何不同)

额外编辑: 其他nuget包正在运行。我正在进步的区域,也是包装重。它只是这一个包给我​​的问题。

控制台登录安装pacakge

Attempting to gather dependency information for package 'Google.ProtocolBuffers.2.4.1.555' with respect to project 'ConsoleApplication1', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Google.ProtocolBuffers.2.4.1.555' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Google.ProtocolBuffers.2.4.1.555'
Resolved actions to install package 'Google.ProtocolBuffers.2.4.1.555'
Adding package 'Google.ProtocolBuffers.2.4.1.555' to folder 'M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages'
Added package 'Google.ProtocolBuffers.2.4.1.555' to folder 'M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages'
Added package 'Google.ProtocolBuffers.2.4.1.555' to 'packages.config'
Successfully installed 'Google.ProtocolBuffers 2.4.1.555' to ConsoleApplication1
========== Finished ==========

文件夹结构(为了理智而删节)

> dir /s                                                                                                                                                   
 Volume in drive M is steam                                                                                                                                
 Volume Serial Number is 747C-43B4                                                                                                                         

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages                                                                

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
16/04/2016  15:04    <DIR>          Google.ProtocolBuffers.2.4.1.555                                                                                       
               0 File(s)              0 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555                               

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
16/04/2016  15:04         2,731,847 Google.ProtocolBuffers.2.4.1.555.nupkg                                                                                 
16/04/2016  15:04    <DIR>          lib                                                                                                                    
16/04/2016  15:04    <DIR>          tools                                                                                                                  
               1 File(s)      2,731,847 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\lib                           

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
16/04/2016  15:04    <DIR>          cf20                                                                                                                   
16/04/2016  15:04    <DIR>          cf35                                                                                                                   
16/04/2016  15:04    <DIR>          net20                                                                                                                  
16/04/2016  15:04    <DIR>          net35                                                                                                                  
16/04/2016  15:04    <DIR>          net40                                                                                                                  
16/04/2016  15:04    <DIR>          portable-net40+sl4+sl5+wp7+wp8+win8                                                                                    
16/04/2016  15:04    <DIR>          sl20                                                                                                                   
16/04/2016  15:04    <DIR>          sl30                                                                                                                   
16/04/2016  15:04    <DIR>          sl40                                                                                                                   
               0 File(s)              0 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\lib\cf20                      

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
19/10/2015  20:39            71,034 Google.ProtocolBuffers.Serialization.xml                                                                               
19/10/2015  20:39           282,553 Google.ProtocolBuffers.xml                                                                                             
               2 File(s)        353,587 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\lib\cf35                      

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
19/10/2015  20:39            71,034 Google.ProtocolBuffers.Serialization.xml                                                                               
19/10/2015  20:39           282,553 Google.ProtocolBuffers.xml                                                                                             
               2 File(s)        353,587 bytes                                                                                                              
 ...
<snip>
...                                                                                                                                                            
 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\tools                         

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
19/10/2015  20:39             6,779 CHANGES.txt                                                                                                            
16/04/2016  15:04    <DIR>          google                                                                                                                 
19/10/2015  20:39             1,672 license.txt                                                                                                            
19/10/2015  20:39             1,857 protoc-license.txt                                                                                                     
16/04/2016  15:04    <DIR>          tutorial                                                                                                               
               3 File(s)         10,308 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\tools\google                  

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
16/04/2016  15:04    <DIR>          protobuf                                                                                                               
               0 File(s)              0 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\tools\google\protobuf         

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
16/04/2016  15:04    <DIR>          compiler                                                                                                               
19/10/2015  20:39             4,301 csharp_options.proto                                                                                                   
19/10/2015  20:39            21,880 descriptor.proto                                                                                                       
               2 File(s)         26,181 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\tools\google\protobuf\compiler

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
19/10/2015  20:39             7,736 plugin.proto                                                                                                           
               1 File(s)          7,736 bytes                                                                                                              

 Directory of M:\programming\general\git\akka-cluster-homebrew\ConsoleApplication1\packages\Google.ProtocolBuffers.2.4.1.555\tools\tutorial                

16/04/2016  15:04    <DIR>          .                                                                                                                      
16/04/2016  15:04    <DIR>          ..                                                                                                                     
19/10/2015  20:39               754 addressbook.proto                                                                                                      
               1 File(s)            754 bytes                                                                                                              

     Total Files Listed:                                                                                                                                   
              26 File(s)      5,960,765 bytes                                                                                                              
              50 Dir(s)  26,398,302,208 bytes free 

1 个答案:

答案 0 :(得分:1)

好的,我最终找到了这个页面: https://connect.microsoft.com/VisualStudio/feedback/details/1656768/installing-certain-nuget-packages-fails-to-actually-extract-the-dll-files-to-the-relevant-lib-folder-and-fails-to-add-an-assembly-reference-to-the-csproj-file

结果我做了两件事 1)转到%userprofile%\.nuget并删除包文件夹(但请记住,我已经完成了这个并且没有单独修复它)。我注意到这里的版本反映了我遇到的问题 - 而且我以前删除了这个,我知道简单地删除这个文件夹是不够的。

2)在管理模式vs dev命令提示符“devenv /resetuserdata

新的解决方案4.5.2,控制台和第一次工作。

是什么造成的? 不是最模糊的。

btw安装包的安慰输出现在是:

Attempting to gather dependency information for package 'Google.ProtocolBuffers.2.4.1.555' with respect to project 'ConsoleApplication2', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Google.ProtocolBuffers.2.4.1.555' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Google.ProtocolBuffers.2.4.1.555'
Resolved actions to install package 'Google.ProtocolBuffers.2.4.1.555'
  GET https://api.nuget.org/packages/google.protocolbuffers.2.4.1.555.nupkg
  OK https://api.nuget.org/packages/google.protocolbuffers.2.4.1.555.nupkg 14ms
Installing Google.ProtocolBuffers 2.4.1.555.
Adding package 'Google.ProtocolBuffers.2.4.1.555' to folder 'c:\users\john\documents\visual studio 2015\Projects\ConsoleApplication2\packages'
Added package 'Google.ProtocolBuffers.2.4.1.555' to folder 'c:\users\john\documents\visual studio 2015\Projects\ConsoleApplication2\packages'
Added package 'Google.ProtocolBuffers.2.4.1.555' to 'packages.config'
Successfully installed 'Google.ProtocolBuffers 2.4.1.555' to ConsoleApplication2
========== Finished ==========