Nuget 3.1.1.0 Service Pack Update

I updated the Nuget package manager to version 3.1.1.0. After opening the update, any project gives me an error message: copy-item: cannot find the path 'c: \ users {username} \ documents \ visual studio 2015 \ projects {project name} \ packages \ Microsoft.CodeDom.Providers.DotNetCompilerPlatform. 1.0.0 \ tools \ lib \ net45 'because it does not exist ..... in the init.ps1 file

I found that the $ installpath variable given by init.ps1 differs from the old nuget to the actual additionally added subdirectory name \ tools, which is clearly incorrect and gives an error.

How can I affect this $ installpath or downgrade nuget option on 3.1.0?

I double checked this behavior also in a new installed vm with the same result, VS installed β†’ ok, upgraded to nuget 3.1.1 β†’ broken.

Environment: Windows 10 German, Visual Studio 2015 Community Edition English

+18
visual-studio nuget
Aug 02 '15 at 9:10
source share
5 answers

I got the same error (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 to:

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

at

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

which fixes the problem (only until you return the package again and get the damaged version).

The real fix is ​​for those supporting the service pack to update their copy of init.ps1 . I will follow up and see if we can do this. :)

+20
Aug 05 '15 at 8:06
source share

Not sure if this will help others, but I got the same error on VS2015 with Microsoft.CodeDom.Providers.DotNetCompilerPlatform and what fixed 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 more errors. No need to edit ps1 files for me.

FWIW.

+20
Sep 04 '15 at 16:02
source share

This issue is tracked by https://github.com/NuGet/Home/issues/1125 we also work with the package owner to find out if he can go with init.ps1 to set up the project. This process is not in accordance with NuGet recommendations, but we are not sure if there is still a workaround.

+2
Aug 6 '15 at 20:45
source share

I got the same error in the package manager console and ended up finding this thread.

As the error message says, the package directory ... \ Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0 \ tools \ lib \ net45 is missing, so the problem.

Is the "lib" directory created for any reason in the "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0" directory? When I moved the "lib" directory to the "tools" directory, restart VS, the error message will disappear.

+2
Aug 21 '15 at 6:28
source share

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

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

This worked:

 $libDirectory = Join-Path $installPath '\lib\net45' 
0
Aug 6 '15 at 8:07
source share



All Articles