Compile C#-Code and C++-Code into one class library

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

    #1

    Compile C#-Code and C++-Code into one class library


    Hello,

    currently, I have one class-library which is generated from a c++.net
    class library project.
    Into this project, I cannot include C# files.
    On the other hand I have some C#-Code which accesses this class
    library.
    What I want to do is provide this C#-Code AND the C++.net-class-
    library together
    in one new class library. How can this be realized from a technical
    point of view?
    I don't want to have two class libraries!

    Thanks!
  • Delicioustian

    #2
    Re: Compile C#-Code and C++-Code into one class library

    Hello~

    I think there is no way to do this. Different programming language have
    different
    compiler.You cannot compile a CSharp code use a C++ compiler.

    "Ezmeralda" <ezmeralda@gmx. de????
    news:3eded49e-d9c1-414f-bcd6-4de13d67c830@i2 9g2000prf.googl egroups.com...
    >
    Hello,
    >
    currently, I have one class-library which is generated from a c++.net
    class library project.
    Into this project, I cannot include C# files.
    On the other hand I have some C#-Code which accesses this class
    library.
    What I want to do is provide this C#-Code AND the C++.net-class-
    library together
    in one new class library. How can this be realized from a technical
    point of view?
    I don't want to have two class libraries!
    >
    Thanks!
    >

    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: Compile C#-Code and C++-Code into one class library

      On Dec 14, 7:44 am, Ezmeralda <ezmera...@gmx. dewrote:
      currently, I have one class-library which is generated from a c++.net
      class library project.
      Into this project, I cannot include C# files.
      On the other hand I have some C#-Code which accesses this class
      library. What I want to do is provide this C#-Code AND the C++.net-class-
      library together in one new class library. How can this be realized from a technical
      point of view? I don't want to have two class libraries!
      Have a look at http://research.microsoft.com/~mbarnett/ILMerge.aspx

      Jon

      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: Compile C#-Code and C++-Code into one class library

        While Jon and Delicioustian have good ideas, there really is a simpler
        way.

        You can use the command line compilers to compile each project into a
        netmodule (look at the command line compiler information for each respective
        language for more info). Once you have those netmodules, you can use the
        assembly linker (al.exe) to link the modules into an assembly.

        You might even be able to modify the MSBUILD scripts to do this for you
        at build time, but I haven't looked into that. It's feasible though.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m

        "Ezmeralda" <ezmeralda@gmx. dewrote in message
        news:3eded49e-d9c1-414f-bcd6-4de13d67c830@i2 9g2000prf.googl egroups.com...
        >
        Hello,
        >
        currently, I have one class-library which is generated from a c++.net
        class library project.
        Into this project, I cannot include C# files.
        On the other hand I have some C#-Code which accesses this class
        library.
        What I want to do is provide this C#-Code AND the C++.net-class-
        library together
        in one new class library. How can this be realized from a technical
        point of view?
        I don't want to have two class libraries!
        >
        Thanks!

        Comment

        Working...