[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

.NET Deployment Problem (Appdomain, Reflection

Niklas Magnusson

10/21/2004 7:51:00 AM

During deployment for a project i want to perform a number of tasks
automatically. for example update a database.
Theese tasks needs configuration settings from the .config file that are
included in the setup project.

The setup project contains a custom action to call an installer class during
setup.
The installer class creates a new AppDomain that uses the provided .Config
file.
Then i Instanciate a MarchalByRef type located in an other assembly using
NewAppDomain.CreateInstanceAndUnwrap. That class is going to load the
assembly/type containing the code i want to run.
It works fine when i execute the code in debug mode or from a
compiled(runtime) Console App.

But when the Microsoft Installer executes it through the custom Action i
recieve this Exception:
System.InvalidCastException: Specified cast is not valid.
NewAppDomain.CreateInstanceAndUnwrap returns an object of type MarchalByRef.
Not the type i expect. Why is that???

I would appreciate help!

Niklas
ts_niklas@hotmail.com