Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "An assembly with the same simple name has already been imported" error message

"An assembly with the same simple name has already been imported" error message

Scheduled Pinned Locked Moved C#
helpquestionannouncement
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    impeham
    wrote on last edited by
    #1

    I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility. I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code. I'm getting compiler error (my real module name was switched with [module name] here): "An assembly with the same simple name '[module name], 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." One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window. The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this? i'm using VS2012.

    J L J 4 Replies Last reply
    0
    • I impeham

      I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility. I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code. I'm getting compiler error (my real module name was switched with [module name] here): "An assembly with the same simple name '[module name], 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." One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window. The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this? i'm using VS2012.

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Using different AppDomains would solve it.

      I 1 Reply Last reply
      0
      • I impeham

        I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility. I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code. I'm getting compiler error (my real module name was switched with [module name] here): "An assembly with the same simple name '[module name], 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." One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window. The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this? i'm using VS2012.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Try this[^] :)

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        I 1 Reply Last reply
        0
        • J jschell

          Using different AppDomains would solve it.

          I Offline
          I Offline
          impeham
          wrote on last edited by
          #4

          It won't solve it since i need to load both assemblies in the same domain.

          1 Reply Last reply
          0
          • L Lost User

            Try this[^] :)

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            I Offline
            I Offline
            impeham
            wrote on last edited by
            #5

            i already found this before, but it does not offer a working solution: i cannot change the assembly info since it is a compiled module and as i said - the assemblies are not signed, but they have a different version. Any other way to make it work?

            L 1 Reply Last reply
            0
            • I impeham

              I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility. I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code. I'm getting compiler error (my real module name was switched with [module name] here): "An assembly with the same simple name '[module name], 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." One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window. The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this? i'm using VS2012.

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              Pretty sure that your requirements, per your posts, means there is no solution. So either relax your requirements or don't do it.

              1 Reply Last reply
              0
              • I impeham

                i already found this before, but it does not offer a working solution: i cannot change the assembly info since it is a compiled module and as i said - the assemblies are not signed, but they have a different version. Any other way to make it work?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                impeham wrote:

                Any other way to make it work?

                Remove the reference and load the assembly dynamic. If you want to use the simple names, you'd have to abide by it's rules.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                1 Reply Last reply
                0
                • I impeham

                  I am trying to reference 2 identical assemblies with only their filename and version to be different. I need this in order to support several versions for backward compatibility. I've created an alias name for one of them and the other stayed "global". Also added the "extern alias" declaration at the start of the source code. I'm getting compiler error (my real module name was switched with [module name] here): "An assembly with the same simple name '[module name], 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." One of these two assemblies does have a version 1.0.0.0, but the other has 1.5.0.0 and I can see that when I highlight them in the solution explorer in the properties window. The assemblies are not signed, and I do not currently wish to make them as such. Why is this error? The versions are clearly different… is there a way to solve this? i'm using VS2012.

                  J Offline
                  J Offline
                  johannesnestler
                  wrote on last edited by
                  #8

                  In an app where you think about "backward compatibility" and other things you should really use strong names for the assemblies - So I'd question why you are not using strong-names (signing). I can't think about a good reason for not doing it (and solving your problem) other than "too lazy to manage the certifcate"... Even if you don't worry about installing your assembly in the GAC or your manufacturer authenticity, there a good reasons for signing - you just found one!

                  I 1 Reply Last reply
                  0
                  • J johannesnestler

                    In an app where you think about "backward compatibility" and other things you should really use strong names for the assemblies - So I'd question why you are not using strong-names (signing). I can't think about a good reason for not doing it (and solving your problem) other than "too lazy to manage the certifcate"... Even if you don't worry about installing your assembly in the GAC or your manufacturer authenticity, there a good reasons for signing - you just found one!

                    I Offline
                    I Offline
                    impeham
                    wrote on last edited by
                    #9

                    Signing the assemblies would probably be the best solution - i agree. At the moment it is not feasible since there are clients with this module in the field already that cannot be upgraded with new signed assemblies. I am using a workaround for this in the meantime - I am changing the assembly name from the project properties (changing the version and the title in assembly information did not work). I still have a few tests to do before I'll know it is working for sure (without the need to upgrade any client modules).

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups