Default AppDomain

S

siger99

Hi,

I try to use a 3rd party assembly ( basically a layer of managed C++
around a native C++ lib).
Unfortunately, it was developped for NET 1.1 and knows only the
default AppDomain.

When I try to call it from another AppDomain, I get the "Cannot pass a
GCHandle across AppDomains" error.

-> is there a way to get the Default AppDomain from the Current
AppDomain?
-> has anybody found a way round this "GCHandle..." error ?

Thanks in advance
 
N

Nicholas Paldino [.NET/C# MVP]

This isn't an error, you are simply doing something that you can not do.
You are not allowed to pass GCHandle instances across app domains, and that
is exactly what you are trying to do.

What exactly are you trying to do here? Why are you passing a GCHandle
across app domains?
 
S

siger99

Hi,

Sorry for the late reply.

I am in a user-defined AppDomain (because I want to be able to unload
the assembly when I am done with it), and from this AppDomain, I call
the
3rd party assembly which expects the defalut AppDomain, hence the
crash.

So I have to figure out how to launch this 3rd party from the default
AppDomain to make it work.

Any idea?

Thanks again
 

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