Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Assembly Same Simple Name already been imported" error

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?

like image 450
rbtLong Avatar asked Dec 22 '12 08:12

rbtLong


3 Answers

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

like image 181
Gregor Primar Avatar answered Oct 24 '22 11:10

Gregor Primar


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.
like image 20
Robert Rouhani Avatar answered Oct 24 '22 11:10

Robert Rouhani


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.

like image 2
BlueStrat Avatar answered Oct 24 '22 11:10

BlueStrat