Combining modules with the Assembly Linker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Nau

    #1

    Combining modules with the Assembly Linker

    I've been trying to get a concrete answer to this for the last few
    days, but have come up short. I'm hoping someone here can help.

    Is there a way to take a set of c# modules (c# code compiled using csc
    with the /t:module option) and combine them into a single assembly
    using the assembly linker or any other tool.

    For example I have the following compiled c# modules:
    foo1.netmodule
    foo2.netmodule

    I'd like to link them into a single .net assembly named foolinked.dll.

    I have tried

    al foo1.netmodule foo2.netmodule /target:library /out:foolinked.d ll

    This created foolinked.dll but when I explore it with ildasm, it only
    contains the assembly manifest and points to foo1.netmodule and
    foo2.netmodule.

    Any help would be greatly appreciated.

    Thanks,
    Mike.
  • Rob Windsor [MVP]

    #2
    Re: Combining modules with the Assembly Linker

    Mike,

    What you described is the expected result from the assembly linker. What you
    created is a multi-file assembly that is made up of foolinked.dll,
    foo1.netmodule and foo2.netmodule. When you deploy the DLL you must also
    deploy the netmodule files as well.

    As an aside this is the only way to create an assembly that contains code
    from different languages.

    I don't think there's any way to use the assembly linker to build a
    single-file assembly from netmodules.

    --
    Rob Windsor [MVP-VB]
    G6 Consulting
    Toronto, Canada


    "Mike Nau" <mikenau1@yahoo .com> wrote in message
    news:b8663c98.0 402110948.60af7 745@posting.goo gle.com...[color=blue]
    > I've been trying to get a concrete answer to this for the last few
    > days, but have come up short. I'm hoping someone here can help.
    >
    > Is there a way to take a set of c# modules (c# code compiled using csc
    > with the /t:module option) and combine them into a single assembly
    > using the assembly linker or any other tool.
    >
    > For example I have the following compiled c# modules:
    > foo1.netmodule
    > foo2.netmodule
    >
    > I'd like to link them into a single .net assembly named foolinked.dll.
    >
    > I have tried
    >
    > al foo1.netmodule foo2.netmodule /target:library /out:foolinked.d ll
    >
    > This created foolinked.dll but when I explore it with ildasm, it only
    > contains the assembly manifest and points to foo1.netmodule and
    > foo2.netmodule.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks,
    > Mike.[/color]


    Comment

    • Huihong

      #3
      Re: Combining modules with the Assembly Linker

      AL does not merge files together, rather it inserts a
      reference into the assembly.

      You will have to use 3rd party tool to physically merge
      modules/assemblies together. We offer such a tool,
      http://www.remotesoft.com/linker, which can link/merge
      files together, it can also link framework DLLs into your
      own assembly.

      Since we don't have trial version yet, you can send your
      files to service@remotes oft.com, and the linked file will
      be sent back to you for evaluation.

      Huihong

      [color=blue]
      >-----Original Message-----
      >I've been trying to get a concrete answer to this for the[/color]
      last few[color=blue]
      >days, but have come up short. I'm hoping someone here can[/color]
      help.[color=blue]
      >
      >Is there a way to take a set of c# modules (c# code[/color]
      compiled using csc[color=blue]
      >with the /t:module option) and combine them into a single[/color]
      assembly[color=blue]
      >using the assembly linker or any other tool.
      >
      >For example I have the following compiled c# modules:
      >foo1.netmodu le
      >foo2.netmodu le
      >
      >I'd like to link them into a single .net assembly named[/color]
      foolinked.dll.[color=blue]
      >
      >I have tried
      >
      >al foo1.netmodule[/color]
      foo2.netmodule /target:library /out:foolinked.d ll[color=blue]
      >
      >This created foolinked.dll but when I explore it with[/color]
      ildasm, it only[color=blue]
      >contains the assembly manifest and points to[/color]
      foo1.netmodule and[color=blue]
      >foo2.netmodule .
      >
      >Any help would be greatly appreciated.
      >
      >Thanks,
      >Mike.
      >.
      >[/color]

      Comment

      Working...