Install problem with C++ and C# together

T

thursday's geek

I am using the Visual Studio 2005 installer on our project, and we just
started moving from C++ to C#. So, most of the code is still C++, but there
are a few projects that are C#. The C# projects are not signed (I was told
that there were issues with signed code calling unsigned code and vice
versa, plus, I don't quite understand all of that yet.)

I am getting warnings when I build the install, and I've searched and it
appears that I can ignore them. I'm including them here, just in case that
is not true. I added Microsoft_VC80_ATL_x86.msm,
Microsoft_VC80_CRT_x86.msm, and Microsoft_VC80_MFC_x86.msm, and get warnings
about "Two or more objects have the same target location
('[payload_ul]\8.0.50727.762.policy')". I also have the ATL, CRT, and MFC
versions of policy_8_0_Microsoft_VC80_nnn_x86.msm which gives warnings about
"Two or more objects have the same target location
('[policydir]\8.0.50727.762.policy')"

Even with those warnings, I can get an install that appears to work. I am
using a virtual machine, and it was installing and mostly running yesterday
morning, and then it quit working. (A co-worker was using a real machine,
and was always getting the same errors.)

Starting mid-day yesterday, as soon as I run my app and get to a part that
would be using a C# project, I get the following.
Runtime Error!
Program: C:\<company name>\<project name>.exe
This application has requested the Runtime to terminate in an unusual way.
Please contact the application's support team for more information.

The exception unknown software exception (0x40000015) occurred in the
application at location 0x781346b4.
Click on OK to terminate the program

We are installing both the C++ and C# dlls in the same directory. I don't
know if I'm doing something wrong that is simple and obvious (to someone who
knows), or if I'm just totally on the wrong path. We also have
Installshield 5.0 (there are valid reasons why we don't have the current
version, but I don't recall them), and I'm going to go try messing with that
and see if I can get any further. I'm walking pretty blind, and if anyone
can provide some light, I'd sure appreciate it.
-karen
 
T

thursday's geek

Oh, and I just tried it with InstallShield 5.0 and get the same error. So
it's definitely something I'm doing worng with integrating C++ and C#
together. Of course, I already knew that.
-karen
 
T

thursday's geek

thursday's geek said:
I am using the Visual Studio 2005 installer on our project, and we just
started moving from C++ to C#. So, most of the code is still C++, but
there are a few projects that are C#. The C# projects are not signed (I
was told that there were issues with signed code calling unsigned code and
vice versa, plus, I don't quite understand all of that yet.)
<snip>

Ok, I went ahead and signed them, and the "Runtime error" went away. But...
the parts of the program that use C# aren't acting correctly. It's like
they are there but not there. That could even be a programming error,
although it works fine in debug and release mode, just not in an installed
release on a clean machine. (I need to try it on a non-virtual machine.)
The .NET 2.0 is there, the interop stuff is registered.

Is this the right place to be asking questions about making c++ and c#
install and work together?
-karen
 
P

Phil Wilson

You proably need to get more data, because "aren't acting correctly" doesn't
really help anyone diagnose this. If they're crashing there'd be an
exception. Adding trace code to apps is ofte a good idea so you can see
ehat's going on. Either way, you'll need to be more specific about what
failures are occurring.

There's no reason why C++ and C# apps can't be in the same app folder.
 
T

thursday's geek

I started a new installer project, and put it together the way the first one
was, and now it seems to work. The C# code is not signed (it won't go in
the GAC anyay), but we'll continue to appraise if we need to sign it. All I
can guess is that some of the thrashing we did in creating the install
managed to damage the install project, and starting over eliminated that
thrash damage.

As for the "aren't acting correctly" quote, you're right, that's not much
information. I was trying to say that the C# parts of the code didn't
appear to be there, but nothing was crashing. So, if my C++ code called
some C# code that drew a section of my window, that C# part of the window
was not drawn, but the C++ code still worked without errors. But, with the
new install project, it now all seems to work. If it stops working again,
or we see something similar, I'll check into adding the trace code.

-karen

Phil Wilson said:
You proably need to get more data, because "aren't acting correctly"
doesn't really help anyone diagnose this. If they're crashing there'd be
an exception. Adding trace code to apps is ofte a good idea so you can see
ehat's going on. Either way, you'll need to be more specific about what
failures are occurring.

There's no reason why C++ and C# apps can't be in the same app folder.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
thursday's geek said:
<snip>

Ok, I went ahead and signed them, and the "Runtime error" went away.
But... the parts of the program that use C# aren't acting correctly.
It's like they are there but not there. That could even be a programming
error, although it works fine in debug and release mode, just not in an
installed release on a clean machine. (I need to try it on a non-virtual
machine.) The .NET 2.0 is there, the interop stuff is registered.

Is this the right place to be asking questions about making c++ and c#
install and work together?
-karen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top