473,472 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.NET Deployment Problem (Appdomain, Reflection)

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
Jul 21 '05 #1
1 1334
Hi Niklas

I'm having the same issue as you are here.

if you found a solution I'd really apprecriate hearing it.

Thanks,
John

jo*******@pioneerinvest.ie
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


User submitted from AEWNET (http://www.aewnet.com/)
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jon Maz | last post by:
Hi All, I would like to have the following folder structure for an asp.net website: MasterFolder |---\AppRoot | --- webform.aspx | --- web.config | --- global.asax
7
by: Dave L | last post by:
I am inquiring about the feasability of being able to determine when an object of a certain type is instantiated. I have a base type that I want to be able to determine when each instance is...
1
by: Raveendra M | last post by:
Hi! I am working with ASP.NET application. In my page I am creating one Application Domain and in that domain I am calling my DLL. Using the methods of the dll. And unloading the Application...
1
by: Charles Herring | last post by:
In my asp.net application I upload a video file and then need to get the duration and other properties. I get "Attempted to access an unloaded AppDomain" when I instanciate the Video object. I am...
4
by: Jack Wright | last post by:
Dear All, Every Virtual directory under IIS is executed in a new AppDomain. This is done by CLR itself. When I deploy a dll under its bin, the AppDomain is restarted as a result all my dlls under...
3
by: hB | last post by:
Hi. Error = "The configuration system can only be set once. Configuration system is already set" Exception Details: System.InvalidOperationExcepti­on: The configuration system can only...
0
by: Niklas Magnusson | last post by:
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...
3
by: Frank Uray | last post by:
Hi all I have a problem with loading a assembly ... I am trying to do the following: - I have a directory with a dll (assembly) in it (not the currect dir.) - I am trying to load this assembly,...
0
by: John Wright | last post by:
I have the following code that creates a new appDomain and loads an exe using reflection. The problem I have is the exe file I pass in is still locked by the application. I have showcopyfiles =...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.