sprocket123
sprocket123

Reputation: 21

Nuget paths are different after csproj upgraded

I am trying to upgrade my WFP project from the VS 2015 format to the new VS 17 format. There is a lot of trial and error involved but I have come across an issue which I can find no solution for online:

Some of my code is looking for a file in a certain location:

name C:\git\myproj\packages\A.B.C.Installer.4.1.7\setup\dbpkg\MyProj.dbpkg is invalid.'

Unfortunately the new nuget places the same file in:

C:\git\myproj\packages\a.b.c.installer\4.1.7\setup\dbpkg\MyProj.dbpkg

It does two things different:

  1. everything is lowercase

  2. instead of appending the version, it create a new directory

How can I configure the nuget client to behave like it did before? I am unable to change my code to match.

Upvotes: 0

Views: 646

Answers (1)

Leo Liu
Leo Liu

Reputation: 76870

How can I configure the nuget client to behave like it did before? I am unable to change my code to match.

I am afraid you have to update your code. That because this is the expected behavior now for the new NuGet.

Package ids and versions are case insensitive in NuGet and are now written out lowercase to the global packages folder to avoid conflicts on case sensitive file systems.

You can check some more details info from following thread:

NuGet PM 3.5.0 incorrectly using lowercase path in *.nuget.targets

So, if you update your project to the new VS 17 format, you have to update you code to resolve this issue. I saw you saying that you are unable to change my code to match, but this change was designed to make nuget work better, there is no ticket for us to return to the past at this moment.

Hope this helps.

Upvotes: 1

Related Questions