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

  • Thread starter Thread starter Ezmeralda
  • Start date Start date
E

Ezmeralda

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!
 
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.
 
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
 
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.
 
Back
Top