locked
An assembly with the same simple name 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side. RRS feed

  • Question

  • User-1723661453 posted

    Hi,

    I am working on c# application. and  I come to know that we are using below 5 dlls as a references in that application.

    1.AxInterop.SHDocVw.dll

    2.Interop.SHDocVw.dll

    3.Microsoft.mshtml.dll

    4.MsHtmHstInterop.dll

    5.MyApp.Excel.Interop.dll

    I got an request to add dll "SHDocVw.dll" in addition to above dlls.So I have downloaded from net  "SHDocVw.dll," (6.1.7601.18222) .. So I have added this reference into our project.

    Once I add this dll and build the code ,I got below error.

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

    Please kindly help me to resolve this error.

    Thursday, June 9, 2016 3:17 PM

Answers

  • User-2057865890 posted

    Hi dudisreenath,

    This error points out that two references have the same assembly identity because the assemblies in question lack strong names, they were not signed, and thus the compiler has no way of distinguishing between them in metadata. Thus, the run time ignores the version and culture assembly name properties. The user should remove the redundant reference, rename one of the references, or provide a strong name for them.

    reference: Compiler Error CS1704

    Try setting the debugger options to use the legacy debug engine: Tools -> Options -> Debugging -> General: check both "Use the legacy C# and VB expression evaluators" and "Use Managed Compatibility Mode".

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 10, 2016 5:25 AM