dotnet / dotnet/msbuild

MSB3243 warning is issued when project references two assemblies with same simple name, but with different strong names.

Open
#715 7 comments 4 reactions 0 assignees View on GitHub
backlog help wanted triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

If you have a project referencing two assemblies with different strong names, but same simple name:

```
Library, Version=2.0.0.0, Culture=neutral, PublicKeyToken=63dc4c2e4fb85cbb
Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=282ebfd59330c047
```

...MSBuild issues bogus warning MSB3243:

```
3> There was a conflict between "Library, Version=2.0.0.0, Culture=neutral, PublicKeyToken=63dc4c2e4fb85cbb" and "Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=282ebfd59330c047".
3>C:\Program Files (x86)\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3243: No way to resolve conflict between "Library, Version=2.0.0.0, Culture=neutral, PublicKeyToken=63dc4c2e4fb85cbb" and "Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=282ebfd59330c047". Choosing "Library, Version=2.0.0.0, Culture=neutral, PublicKeyToken=63dc4c2e4fb85cbb" arbitrarily.
```

In reality, both assemblies are given different aliases in project file:

```

{5effb800-ff22-4fdd-a0b0-bdc04cd2862e}
Library1
Library1


{1a61b570-2451-4632-94fe-4a467e7c339c}
Library2
Library2

```

...and code uses extern alias directives to distinguish them:

```
extern alias Library1;
extern alias Library2;

```

Take [repro solution](https://1drv.ms/u/s!AugYigYwj-wfzPU1edw6WZUgM8l3aQ) compile it, and add both Library.dll's to the GAC. Repro.exe works just fine.

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.