If your solution has projectreferences that refer to the same project, with different casing, restore may not work. This also affects different relative paths, without a difference in casing #4574

Closed
iskiselev opened this Issue Feb 10, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@iskiselev

iskiselev commented Feb 10, 2017

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): nuget.exe, msbuild /t:Restore
NuGet version (x.x.x.xxx): 4.0 RC
VS version (if appropriate): VS 15.0.0-RC4+26206.0
Worked before? If so, with which NuGet version: VS 2015 / NuGet 3.5

Detailed repro steps so we can see the same problem

  1. Checkout example from https://github.com/iskiselev/NuGetCaseSensitiveBug
  2. nuget restore Test.sln or msbuild /t:restore Test.sln

Several errors will be reported. Root cause of problem is using path "....\services\Proj1\Proj1.csproj" instead of "....\Services\Proj1\Proj1.csproj" in file "BusinessLogic\Proj3\Proj3.csproj".
Unfortunately, file with root cause was also never reported in error message, so it was very hard to find it in 100+ project solution.

Solution could be built inside VS 2017 without problems.

@rrelyea rrelyea added this to the 4.0 RTM milestone Feb 13, 2017

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Feb 13, 2017

Contributor

Let's dig into this one and understand the problem. Do nuget.exe and msbuild /t:restore have a problem that VS and dotnet.exe don't?
Or is this just the change in 3.5rtm to treat packages as case insensitive and store them as lower case on disk, etc...
/cc: @joelverhagen

Contributor

rrelyea commented Feb 13, 2017

Let's dig into this one and understand the problem. Do nuget.exe and msbuild /t:restore have a problem that VS and dotnet.exe don't?
Or is this just the change in 3.5rtm to treat packages as case insensitive and store them as lower case on disk, etc...
/cc: @joelverhagen

@rohit21agrawal rohit21agrawal self-assigned this Feb 13, 2017

@iskiselev

This comment has been minimized.

Show comment
Hide comment
@iskiselev

iskiselev Feb 13, 2017

Sample doesn't work with nuget 4.0, dotnet (1.0.0-rc4-004771), msbuild 2017 RC4. It works with VS 2017 RC4 and nuget 3.5.

iskiselev commented Feb 13, 2017

Sample doesn't work with nuget 4.0, dotnet (1.0.0-rc4-004771), msbuild 2017 RC4. It works with VS 2017 RC4 and nuget 3.5.

@rrelyea rrelyea changed the title from Case sensitivity restore issue to Case sensitivity restore (command line) issue when project path/name doesn't match actual file system Feb 14, 2017

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Feb 15, 2017

Contributor

@rohit21agrawal - can you please determine how VS, dotnet add project, and other techniques could let a user get into this. Or is is just hand editing?

Contributor

rrelyea commented Feb 15, 2017

@rohit21agrawal - can you please determine how VS, dotnet add project, and other techniques could let a user get into this. Or is is just hand editing?

@rrelyea rrelyea modified the milestones: 4.0.1, 4.0 RTM Feb 15, 2017

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 15, 2017

Contributor

@rrelyea so i have confirmed that you can never get to this inconsistent casing using a tool like VS, or the dotnet add project command . The only way to get into this state is if you hand-edit the csproj and add the project reference manually.

However, the issue is not as simple as i thought, this only repro's when more than one project( say ProjB and ProjC) reference a project (say ProjA) such that the casing of their reference is inconsistent. Something like this:

ProjB: <ProjectReference Include = "..\..\FolderA\projA.csproj"/>
ProjC: <ProjectReference Include = "..\..\folderA\projA.csproj"/>

The incosistency of casing in f in FolderA is what causes this issue.

OR

ProjB: <ProjectReference Include = "..\..\FolderA\projA.csproj"/>
ProjC: <ProjectReference Include = "..\FolderA\projA.csproj"/>

In this case the relative path string are different.

Contributor

rohit21agrawal commented Feb 15, 2017

@rrelyea so i have confirmed that you can never get to this inconsistent casing using a tool like VS, or the dotnet add project command . The only way to get into this state is if you hand-edit the csproj and add the project reference manually.

However, the issue is not as simple as i thought, this only repro's when more than one project( say ProjB and ProjC) reference a project (say ProjA) such that the casing of their reference is inconsistent. Something like this:

ProjB: <ProjectReference Include = "..\..\FolderA\projA.csproj"/>
ProjC: <ProjectReference Include = "..\..\folderA\projA.csproj"/>

The incosistency of casing in f in FolderA is what causes this issue.

OR

ProjB: <ProjectReference Include = "..\..\FolderA\projA.csproj"/>
ProjC: <ProjectReference Include = "..\FolderA\projA.csproj"/>

In this case the relative path string are different.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 15, 2017

Contributor

This also seems to be a regression as @iskiselev pointed out , since it works with NuGet 3.5, but doesn't work with 4.0.0 builds.

Contributor

rohit21agrawal commented Feb 15, 2017

This also seems to be a regression as @iskiselev pointed out , since it works with NuGet 3.5, but doesn't work with 4.0.0 builds.

@rohit21agrawal rohit21agrawal added Type:Bug and removed Investigate labels Feb 15, 2017

@rrelyea rrelyea modified the milestones: 4.0 RTM, 4.0.1 Feb 16, 2017

@rrelyea rrelyea changed the title from Case sensitivity restore (command line) issue when project path/name doesn't match actual file system to If your solution has projectreferences that refer to the same project, with different casing, restore may not work. This also affects different relative paths, without a difference in casing Feb 17, 2017

@emgarten emgarten modified the milestones: 4.3, Future-0 Mar 2, 2017

@sharwell sharwell referenced this issue in Microsoft/perfview Jul 23, 2017

Merged

Move entire solution to new project system #319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment