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*******@hotmail.com