Nuget package manager update 3.1.1.0 broken

前端 未结 5 1485
北海茫月
北海茫月 2020-12-30 01:05

I updated Nuget package manager to version 3.1.1.0. After the update opening any project gives me the error message: copy-item: cannot find path \'c:\\users{username}\\docum

相关标签:
5条回答
  • 2020-12-30 01:11

    Not sure if this will help others, but I got the exact same error on VS2015 with Microsoft.CodeDom.Providers.DotNetCompilerPlatform and what fixed it for me was to do the following in the Package Manager Console:

    Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
    

    Then after saving, closing and reopening VS, no more errors. No need to edit any ps1 files for me.

    FWIW.

    0 讨论(0)
  • 2020-12-30 01:13

    I got the same error in Package Manager Console and eventually found this thread.

    As the error message said, the packages ...\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\lib\net45 directory is missing hence the problem.

    The "lib" directory is created directly under "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0" directory for some reason? When I moved the "lib" directory into "tools" directory, restart VS, error message gone.

    0 讨论(0)
  • 2020-12-30 01:21

    I got the same error as well (as follows):

    Copy-Item : Cannot find path 'C:\Development\GitHub\pd-tech-demo\backend\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\lib\net45' because it does not exist.
    At C:\Development\GitHub\pd-tech-demo\backend\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\init.ps1:23 char:1
    + Copy-Item $libDirectory\* $binDirectory | Out-Null
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Development\...tools\lib\net45:String) [Copy-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
    

    I changed line 10 of init.ps1 from:

    $libDirectory = Join-Path $installPath 'lib\net45'
    

    to:

    $libDirectory = Join-Path $installPath '..\lib\net45'
    

    which fixes the problem (only until you restore the package again and you get the broken version).

    The real fix is for the package maintainers to update their copy of init.ps1. I'll follow up and see if we can get that done. :)

    0 讨论(0)
  • 2020-12-30 01:28

    I also had this error. Changing line 10 of init.ps1 to: This did not work:

    $libDirectory = Join-Path $installPath '..\lib\net45'
    

    This did work:

    $libDirectory = Join-Path $installPath '\lib\net45'
    
    0 讨论(0)
  • 2020-12-30 01:33

    This issue is Tracked by https://github.com/NuGet/Home/issues/1125 we are also working with the package owner to see if he can move off using init.ps1 for setting up the project. This process does not follow the NuGet guidelines, but we are not sure if there is a workaround yet.

    0 讨论(0)
提交回复
热议问题