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. Dll Merge

Dll Merge

Scheduled Pinned Locked Moved C#
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.
  • V Offline
    V Offline
    Visionsoft
    wrote on last edited by
    #1

    I'm writing a class library which contains a couple dlls. Is it possible to have one combined dll of my class libary and the other dlls i'm using. I just want to make a single redistributable dll. Is it possible? Note: I don't have the code for the dlls i'm using in the class library. Only have the dll itself Thanks in advance

    H 1 Reply Last reply
    0
    • V Visionsoft

      I'm writing a class library which contains a couple dlls. Is it possible to have one combined dll of my class libary and the other dlls i'm using. I just want to make a single redistributable dll. Is it possible? Note: I don't have the code for the dlls i'm using in the class library. Only have the dll itself Thanks in advance

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Yes, but call them what they are: assemblies. An assembly contains a manifest at the very least. It can also contained 0 or more embedded resources, assembly attributes, and modules. Those modules are what contains your IL (intermediate language) that the compiler generates. Unfortunately, VS.NET won't help. You can only compile to modules using the command-line compilers. For the C# compiler, this uses the /t:module switch. When you compile the last project, you use an assembly switch (everything else but /t:module, like /t:library for a class library) and then use /addmodule:<path> to add the other modules. This will create an assembly with multiple modules. By why are you worried about sending out multiple DLLs? You should install them into the GAC anyway, which takes care of versioning problems. By distributing the Types, this also gives you more flexible control over independently versioning assemblies. You can redirect assembly bindings using a publisher policy - a specify type of assembly that gets installed into the GAC. So, if class library A depends on B, but you had to change B and don't need to change A, then you must tell assembly A to look at the new version of B. This is assembly version redirection. When you start having larger projects (I managed a product with over 60 possible assemblies, depending on the edition someone buys), this is a must since you don't always need to recompile everything (especially a problem when you're doing touchless-deployment over the Internet like we are). Just something to consider.

      Microsoft MVP, Visual C# My Articles

      L 1 Reply Last reply
      0
      • H Heath Stewart

        Yes, but call them what they are: assemblies. An assembly contains a manifest at the very least. It can also contained 0 or more embedded resources, assembly attributes, and modules. Those modules are what contains your IL (intermediate language) that the compiler generates. Unfortunately, VS.NET won't help. You can only compile to modules using the command-line compilers. For the C# compiler, this uses the /t:module switch. When you compile the last project, you use an assembly switch (everything else but /t:module, like /t:library for a class library) and then use /addmodule:<path> to add the other modules. This will create an assembly with multiple modules. By why are you worried about sending out multiple DLLs? You should install them into the GAC anyway, which takes care of versioning problems. By distributing the Types, this also gives you more flexible control over independently versioning assemblies. You can redirect assembly bindings using a publisher policy - a specify type of assembly that gets installed into the GAC. So, if class library A depends on B, but you had to change B and don't need to change A, then you must tell assembly A to look at the new version of B. This is assembly version redirection. When you start having larger projects (I managed a product with over 60 possible assemblies, depending on the edition someone buys), this is a must since you don't always need to recompile everything (especially a problem when you're doing touchless-deployment over the Internet like we are). Just something to consider.

        Microsoft MVP, Visual C# My Articles

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        I problem with modules is that one module cant access another module in the same assembly :| top secret xacc-ide 0.0.1

        H 1 Reply Last reply
        0
        • L leppie

          I problem with modules is that one module cant access another module in the same assembly :| top secret xacc-ide 0.0.1

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          They can, but modules and assemblies have to be compiled with a single command. csc.exe can produce multiple output files at the same time, but the first /out: has to contain the manifest. If you do it that way (or use pre-proc defs and a two-stage build, which is what I did a while back), modules can even access internal types in other modules within that assembly.

          Microsoft MVP, Visual C# My Articles

          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