Search code examples
nugetnuget-packagenuget-package-restoreprotobuf-csharp-port

why Is [Insert Nuget Package Here] not extracting dlls


So I accept that something v strange is happening on my end with caching or something. Obviously have emptied caches, deleted packages folder and regot packages.

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

Renamed the nupkg zip, looked in and the dll are there. They just arn't extracted - that said the nuspec looks wrong for the folder structure in it. But find it hard to believe its just me having this problem.

I have never had this behavior before and have sunk about 2 hours into it. So hopefully someone can point out the really obvious and explain why a package that i have used in the past is suddenly fubar.

edit for more info: I reproduced using a 4.6.1 console project in vs2015 enterprise (just standard .net not dnx or anything funky). Just tried with a 4.5.2 and i have the same issue. No references get added to any dll in the project. Moreover in the packages folder there are no dll - the xml files make it over though. However if i go into the nupkg, rename to .zip and open i can see the dll where they are supposed to be. I also run vs as admin generally - the package install also fails from command line (not that i expected anything different)

Extra edit: Also other nuget packages are working. Im progressing ohter areas which are also package heavy. Its just this one package that is giving me problems.

console log on installing the 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 ==========

folder structure (abridged for sanity)

> 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 

Solution

  • ok i found this page eventually: 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

    I did 2 things as a result 1) goto %userprofile%\.nuget and delete the packages folder (but bear in mind i had already done that and not fixed it alone). I noticed that the version in here reflected the problems i was having - moreover as i deleted this previously i know simply deleting this folder was not sufficient.

    2) in admin mode vs dev command prompt "devenv /resetuserdata"

    new solution 4.5.2, console and worked first time.

    What caused this? Not the foggiest.

    btw the consoel output from installing the package is now:

    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 ==========