Linking Mixed Mode and Managed Assemblies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?aWduaGVucnk=?=

    Linking Mixed Mode and Managed Assemblies

    I have a managed C++ project and two C# projects. All are class library
    projects. The C++ project links with native C++ static libraries and
    references to one C# project. The projects structure goes something like this.

    Proj2_MCPP --(references)--Proj1_CSharp
    Proj3_CSharp --(references)--Proj2_MCPP and Proj1_CSharp

    My objective is to link the DLLs produced by the 3 projects into a single DLL.

    I tried the following scenario.
    1. csc Proj1_CSharp into a netmodule
    2. cl Proj2_MCPP with /LN and /clr:oldSyntax switch to produce .obj files
    3. csc Proj3_CSharp with /AddModule option and use .netmodule and .obj files
    as input
    4. Link 1, 2 and 3 into a dll.

    and I also tried this.
    1. csc Proj1_CSharp into a netmodule
    2. Build Proj2_MCPP from VS.NET 2005 (based on
    http://support.microsoft.com/kb/309805) to produce .netmodule and obj .files.
    3. csc Proj3_CSharp with /AddModule option and use .netmodule and .obj files
    as input
    4. Link 1, 2 and 3 into a dll.

    I never managed to reach step 4. I just stuck with error messages resulted
    from step 3.

    Am I doing the right thing? Or it is just not possible?

    Thanks - Henry
Working...