Hello,
I'm using AppDomains to launch another .NET application from within my
application.
The code looks like this:
<snip>
try
{
AppDomain app = AppDomain.CreateDomain( guestAppName );
app.ExecuteAssembly( dir + guestAppName );
}
catch ( Exception e )
{
System.Console.WriteLine( "There was a problem with the guest application:
" + e.ToString() );
}
</snip>
This works well with some guest application but with others, very similar
ones, I get the following error message:
<snip>
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Cannot pass a GCHandle across app domains.
</snip>
Besides from the code pasted above, there is no interaction between the
applications (parameters are passed by writing them to a database before
launching the guest application), so I have a hard time to track down the
source of the exception.
Also, this exception is not caught by the try / catch block around the
ExcuteAssembly statement.
I haven't found anything on the internet about that particular exception,
so maybe someone here can give me some hints on what might cause this
exception to occur.
I know that my code example isn't very specific, but posting the code of
the guest applications is not an option for various reasons (most of them
are practical :) ).
so, please help! I'm using .NET 1.1 and VS 2003 by the way...
tia,
melg,
dIdl
--
Dietmar
Hauser, Software Developer
dion-software, ViennaEurope; d.******@dion-software.com
tel.: +43 (0)1 512 60 35 -31
fax.: +43 (0)1 512 60 35 -12
hegelgasse 6/10, a-1010 vienna, http://www.dion-software.com