installing nuget package “same key has already been added.”

后端 未结 12 1385
太阳男子
太阳男子 2020-12-10 00:38

i am trying to install Microsoft.Bcl.Build 1.0.14

nuget returns

Installing \'Microsoft.Bcl.Build 1.0.14\'. Successfully installed \'Microsoft.Bcl.Bu         


        
12条回答
  •  再見小時候
    2020-12-10 01:22

    Your stack-trace tells the tale, it is NuGet.NetPortableProfileTable.BuildPortableProfileCollection() that fails. In a nutshell, it iterates the set of PCL reference assembly profiles and encounters the same profile more than once. This is a very strong hint that the content of your c:\program files (x86)\reference assemblies\microsoft\framework\.netportable directory is corrupted.

    There are many possible ways to go about fixing the damage:

    • If you have an active recollection of tinkering with this directory, like copying files, then undo what you did.
    • Safest way to go about it is to uninstall all Visual Studio versions >= VS2010. Then clean up the directory by hand, deleting any stray files that are still present. Then reinstalling VS again.
    • The not-so-safe but speedier way is to rename the c:\program files (x86)\reference assemblies directory and install the multi-targeting pack. I can't promise success.
    • You can try to find the duplicate yourself and remove it. The directory structure looks like this:

     Directory of C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile
    
    05/14/2014  01:01 PM              Profile1
    05/14/2014  01:01 PM              Profile102
    05/14/2014  01:01 PM              Profile104
    05/14/2014  01:01 PM              Profile131
    05/14/2014  01:01 PM              Profile136
    05/14/2014  01:01 PM              Profile14
    05/14/2014  01:01 PM              Profile143
    05/14/2014  01:01 PM              Profile147
    05/14/2014  01:01 PM              Profile154
    05/14/2014  01:01 PM              Profile158
    05/14/2014  01:01 PM              Profile18
    05/14/2014  01:01 PM              Profile19
    05/14/2014  01:01 PM              Profile2
    05/14/2014  01:01 PM              Profile225
    05/14/2014  01:01 PM              Profile23
    05/14/2014  01:01 PM              Profile24
    05/14/2014  01:01 PM              Profile240
    05/14/2014  01:01 PM              Profile255
    05/14/2014  01:01 PM              Profile3
    05/14/2014  01:01 PM              Profile328
    05/14/2014  01:01 PM              Profile336
    05/14/2014  01:01 PM              Profile344
    05/14/2014  01:01 PM              Profile36
    05/14/2014  01:01 PM              Profile37
    05/14/2014  01:01 PM              Profile4
    05/14/2014  01:01 PM              Profile41
    05/14/2014  01:01 PM              Profile42
    05/14/2014  01:01 PM              Profile46
    05/14/2014  01:01 PM              Profile47
    05/14/2014  01:01 PM              Profile5
    05/14/2014  01:01 PM              Profile6
    05/14/2014  01:01 PM              Profile88
    05/14/2014  01:01 PM              Profile92
    05/14/2014  01:01 PM              Profile95
    05/14/2014  01:01 PM              Profile96
    
     Directory of C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile
    
    05/14/2014  12:59 PM              .
    05/14/2014  12:59 PM              ..
    05/14/2014  01:01 PM              Profile111
    05/14/2014  01:01 PM              Profile259
    05/14/2014  01:01 PM              Profile49
    05/14/2014  01:01 PM              Profile7
    05/14/2014  01:01 PM              Profile78
    
     Directory of C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.6\Profile
    
    05/14/2014  12:59 PM              .
    05/14/2014  12:59 PM              ..
    05/14/2014  01:01 PM              Profile151
    05/14/2014  01:01 PM              Profile157
    05/14/2014  01:01 PM              Profile31
    05/14/2014  01:01 PM              Profile32
    05/14/2014  01:01 PM              Profile44
    05/14/2014  01:01 PM              Profile84
    

提交回复
热议问题