views:

35

answers:

2

I'm getting the following error:

error CS1704: An assembly with the same simple name 'Interop.xxx.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.

Everything I've seen says that I am referencing two assemblies with the same name and I need to remove one of them. However, I've checked and I'm only referencing it once.

This also only happens when I'm using msbuild to build from the command line on my dev box. If I build through Visual Studio or do a clean build on our CI server I don't see this error.

I've tried completely removing all of my source and building from scratch to more closely resemble the build machine but no luck.

+1  A: 

If this is a web project, are there any strong-named references to the other version there? Those won't show up as a project dependency, but will cause a run-time error like you describe. Hope that helps

Robert Seder
+1  A: 

So it looks like I can't read today!
The project had a reference to the Interop and a COM reference that generated the "same" interop. So there were two and I just didn't search very well. I still don't understand why it worked in other places but this did fix it.

drs9222
+1 - Thanks - this error just popped up on me out of the blue today, and I had exactly the same problem.
Shaul