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. Visual Basic
  4. Class Library references

Class Library references

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 3 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.
  • B Offline
    B Offline
    beowulfagate
    wrote on last edited by
    #1

    I created a Class library in a multi-project solution. This library is being referenced by many other libraries in different projects in the same solution. When I compile this library I would manually remove references to this library and then reference it again. Is there another way to do this?

    S D 2 Replies Last reply
    0
    • B beowulfagate

      I created a Class library in a multi-project solution. This library is being referenced by many other libraries in different projects in the same solution. When I compile this library I would manually remove references to this library and then reference it again. Is there another way to do this?

      S Offline
      S Offline
      sukesh g
      wrote on last edited by
      #2

      Hi, Another way of doing this is use the Reflection Class,which dynamically Loads the Assembly at run time. and also Unloads the Assembly. So, you use the Assembly when ever you want at Runtime. Regards, Sukesh. Sukesh.g

      1 Reply Last reply
      0
      • B beowulfagate

        I created a Class library in a multi-project solution. This library is being referenced by many other libraries in different projects in the same solution. When I compile this library I would manually remove references to this library and then reference it again. Is there another way to do this?

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        The problem is probably because you are using automatic versioning in your Class library project. Open the Assembly.vb file and change the Assembly Version attribute from "1.*.*" (auto-increment versioning) to "1.0.0.0" or whatever you want for a version number. Then, all your other projects that reference this assembly will reference the same version of the assembly. In other words, your projects are referencing your Class assembly. When that reference is created, is it created with the version number of the last time you compiled the Class into an assembly. The '*'s in the Assembly version attribute of your Class project denote numbers where the compiler will automatically increment the version number. When your other projects that reference this assembly are run, they load the Class assembly with the same version that was used when the reference was created. If your app references your Class with the Class's version at 1.0.2039, then the app will always expect version 1.0.2039 to be there. Now, if you set a reference to the Class assembly, you'll run into the problem that your having now. If you create the reference to the Class project, the versioning problem will go away, but you'll still have to change the Assembly version of your Class project to a static number. Otherwise, when you compile your Class assembly, you'll have to recompile all the projects that reference it to. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        B 1 Reply Last reply
        0
        • D Dave Kreskowiak

          The problem is probably because you are using automatic versioning in your Class library project. Open the Assembly.vb file and change the Assembly Version attribute from "1.*.*" (auto-increment versioning) to "1.0.0.0" or whatever you want for a version number. Then, all your other projects that reference this assembly will reference the same version of the assembly. In other words, your projects are referencing your Class assembly. When that reference is created, is it created with the version number of the last time you compiled the Class into an assembly. The '*'s in the Assembly version attribute of your Class project denote numbers where the compiler will automatically increment the version number. When your other projects that reference this assembly are run, they load the Class assembly with the same version that was used when the reference was created. If your app references your Class with the Class's version at 1.0.2039, then the app will always expect version 1.0.2039 to be there. Now, if you set a reference to the Class assembly, you'll run into the problem that your having now. If you create the reference to the Class project, the versioning problem will go away, but you'll still have to change the Assembly version of your Class project to a static number. Otherwise, when you compile your Class assembly, you'll have to recompile all the projects that reference it to. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          B Offline
          B Offline
          beowulfagate
          wrote on last edited by
          #4

          Thanks. I finally got it.

          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