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. Statically linking dependency assemblies

Statically linking dependency assemblies

Scheduled Pinned Locked Moved C#
learning
7 Posts 4 Posters 3 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.
  • S Offline
    S Offline
    softp_vc
    wrote on last edited by
    #1

    Hi Friends I have a console application that produce assembly in .EXE. This app has some dependency assemblies which it reference in the project. Now i want to give my client only the .EXE file. So i want to statically link the dependency assemblies in this .EXE . The Assembly Linker tool(al.exe) only links the modules or the resource files. Any pointer and idea is most welcome. Thanx a lot Naveen

    L 1 Reply Last reply
    0
    • S softp_vc

      Hi Friends I have a console application that produce assembly in .EXE. This app has some dependency assemblies which it reference in the project. Now i want to give my client only the .EXE file. So i want to statically link the dependency assemblies in this .EXE . The Assembly Linker tool(al.exe) only links the modules or the resource files. Any pointer and idea is most welcome. Thanx a lot Naveen

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

      Static linking is not supported by the .NET framework. True, you can combined a few assemblies, but its purely a hack, not static linking in the true sense. .NET is designed around dynamic assemblies that are self-describing. top secret xacc-ide 0.0.1

      S 1 Reply Last reply
      0
      • L leppie

        Static linking is not supported by the .NET framework. True, you can combined a few assemblies, but its purely a hack, not static linking in the true sense. .NET is designed around dynamic assemblies that are self-describing. top secret xacc-ide 0.0.1

        S Offline
        S Offline
        softp_vc
        wrote on last edited by
        #3

        hi leppie Thanx for info. Yes my main requirement is to combine few assemblies into one main assembly(.EXE) nad just give my client the .EXE file. If you the solution or any idea ,please do let me know Thanx a lot Naveen

        C 1 Reply Last reply
        0
        • S softp_vc

          hi leppie Thanx for info. Yes my main requirement is to combine few assemblies into one main assembly(.EXE) nad just give my client the .EXE file. If you the solution or any idea ,please do let me know Thanx a lot Naveen

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          softp_vc wrote: Yes my main requirement is to combine few assemblies into one main assembly I am curious. Why? What is wrong with distributing a few assemblies? If this was really an important requirement why didn't you build it as one exe in the first place?


          "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

          S 1 Reply Last reply
          0
          • C Colin Angus Mackay

            softp_vc wrote: Yes my main requirement is to combine few assemblies into one main assembly I am curious. Why? What is wrong with distributing a few assemblies? If this was really an important requirement why didn't you build it as one exe in the first place?


            "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

            S Offline
            S Offline
            softp_vc
            wrote on last edited by
            #5

            Hi you are right at your place. But right now my concern is to link the dependent assembly into the main assembly file. Hope any body would be having the idea for this Regards, Naveen

            H 1 Reply Last reply
            0
            • S softp_vc

              Hi you are right at your place. But right now my concern is to link the dependent assembly into the main assembly file. Hope any body would be having the idea for this Regards, Naveen

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

              I don't think you understand: it isn't supported. And if you're referring to the .NET base class library assemblies (mscorlib.dll, System.dll, etc.), then I'm guessing you also don't want the client to have the .NET Framework installed, huh? Guess what - that's not possible, either. The .NET Framework is more than just .NET assemblies - it's a complete runtime made up of system components and must be installed. There is a project somewhere on the web that attempts to circumvent this, but all it really does is collect only the required components of .NET for a particular application and install them locally into a directory. It's still the .NET Framework, just a hack and not installed as system components, thus bloating the system. Just like Java requires a JVM and VB6 and lower requires a VB VM (virtual machine), .NET requires the CLR. Colin is right, though: if the dependent assemblies are ones you created, then don't create dependent assemblies and create all the code into one .EXE assembly.

              Microsoft MVP, Visual C# My Articles

              S 1 Reply Last reply
              0
              • H Heath Stewart

                I don't think you understand: it isn't supported. And if you're referring to the .NET base class library assemblies (mscorlib.dll, System.dll, etc.), then I'm guessing you also don't want the client to have the .NET Framework installed, huh? Guess what - that's not possible, either. The .NET Framework is more than just .NET assemblies - it's a complete runtime made up of system components and must be installed. There is a project somewhere on the web that attempts to circumvent this, but all it really does is collect only the required components of .NET for a particular application and install them locally into a directory. It's still the .NET Framework, just a hack and not installed as system components, thus bloating the system. Just like Java requires a JVM and VB6 and lower requires a VB VM (virtual machine), .NET requires the CLR. Colin is right, though: if the dependent assemblies are ones you created, then don't create dependent assemblies and create all the code into one .EXE assembly.

                Microsoft MVP, Visual C# My Articles

                S Offline
                S Offline
                softp_vc
                wrote on last edited by
                #7

                Hi friends Thanx very much for giving me such a useful info and having a discussion with me. I look forward for such a discussion in future Thanx again Naveen

                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