"Assembly Same Simple Name already been imported" error
Asked Answered
G

5

17

This is a CLR project. I'm importing two DLL files with the same name, quizz.dll (I rename the old version as legacyquizz.dll) and I include the newer version as quizz.dll into a legacy converter test project. (The legacy converter project being tested only imports the old quizz.dll).

This is the error I'm getting . . .

An assembly with the same simple name 'Quizz, Version=2.0.0.1, Culture=neutral, PublicKeyToken=null has already been imported.

Try removing one of the references or sign them to enable side-by-side. c:\ . . . \Quizz.dll

The path it's pointing to is the destination of the newer version of quizz.dll.

I'm using an external alias on the legacyquizz.dll file:

extern alias legacy;

What is a "simple name" in this context?

Glimp answered 22/12, 2012 at 8:15 Comment(2)
Try renaming the assembly name from project properties of one of the quizz projects.Calbert
I can't do that it's grayed out.Glimp
C
10

You can see the simple name by opening project properties and selecting Assembly Information:

enter image description here

To sign the assembly you need to select Signing tab and create or select signing key:

enter image description here

Chillon answered 22/12, 2012 at 8:33 Comment(0)
C
4

If you are working with the new .csproj version, you may encounter this problem after you add a reference to another solution project, if the reference already exists as an Assembly Dependency (this reference may have been added automatically by Visual Studio).

On Solution Explorer, expand the conflicting project, navigate to Dependencies->Assemblies and check that there is not an existing reference to the assembly that is raising the conflict. If it exists, just delete it and the conflict will be resolved.

Croesus answered 27/6, 2019 at 17:1 Comment(0)
R
3

You have two assemblies with the same name (not file name, assembly name). There are two solutions to this:

  1. Rename one of the assemblies from the project's properties and recompile.
  2. Set up Strong-Name Signing on the assembly to allow two separate versions of the same assembly to coexist.
Rotherham answered 22/12, 2012 at 8:34 Comment(0)
S
0

For me deleting the bin folders and building worked. Rebuilding alone doesn't do the trick if you have an older version dependency in the bin folder side by side with the one you're rebuilding.

Sheehan answered 15/5 at 14:16 Comment(0)
I
-2

I too seems this problem in my project. I had changed my dll path to another folder, and changed the reference path too for the same(dependency Layers). It will work. No duplication occurs.

Intellectual answered 19/9, 2015 at 5:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.