dotnet / dotnet/msbuild

ResolveAssemblyReferences eats project reference with same name as a nuget reference

Open
#4,060 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Steps to reproduce

1. Create Solution A with a .Net Core class library TestClassLibrary.
Build the project, pack it into a nuget (right-click the project node in VS and choose publish/pack)

2. Create Solution B with a Console App project and a class library called TestClassLibrary.
Rename its namespace and class name to TestClassLibrary2.Class2
Don't add it as a project reference yet.

3. Add the nuget as a reference to Console App. Use TestClassLibrary.Class1 in your Main() function and see that it compiles.
Now add the TestClassLibrary project reference to Console App. Try to use TestClassLibrary2.Class2.

Notice that the project no longer compiles and that one reference removed the other, even though they have different paths (but same names).

### Environment

- Found this on the WPF repo where TestClassLibrary is WindowsBase.dll which is both in the .NetCore SDK and as a project reference to PresentationCore.
- VS 2019 Preview 2 28503.212.d16.0stg

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.