Hi,
I'm currently setting up a deployment project using Visual Studio .NET 2003 which will deploy a web application. In my deployment project I’ve created a Custom Action by adding an installer class which overrides the Install and Uninstall methods.
In my install method, I'm trying to save a bunch of 'state' information in System.Collections.IDictionary so I added the following code:
stateSaver.Add("EnvironmentState", Me.Context.Parameters.Item("environment"))
stateSaver.Add("WebsiteState", Me.Context.Parameters.Item("Website"))
stateSaver.Add("VirtualDirState", Me.Context.Parameters.Item("virtualDir"))
In my Uninstall method, I have a simple windows message box which attempts to display one of these state information (I’m using just a message box in an attempt to debug the problem I’m getting), something like this:
MessageBox.Show(savedState("WebsiteState"))
When I run the Built MSI, the install process works fine. However when I attempt to Remove the web application through the MSI, I get the common ‘NULL reference exception'. I discovered that by adding more than one ‘state’ info (in the install class), causes this NULL reference exception. If I only have ONE state info, the uninstall process works fine (displaying the website value in the message box).
I thought that stateSaver.Add was OK for me to add multiple state information as long as I have a unique key. What’s going wrong?
Your help will be much appreciated.
Regards,
Assad
I'm currently setting up a deployment project using Visual Studio .NET 2003 which will deploy a web application. In my deployment project I’ve created a Custom Action by adding an installer class which overrides the Install and Uninstall methods.
In my install method, I'm trying to save a bunch of 'state' information in System.Collections.IDictionary so I added the following code:
stateSaver.Add("EnvironmentState", Me.Context.Parameters.Item("environment"))
stateSaver.Add("WebsiteState", Me.Context.Parameters.Item("Website"))
stateSaver.Add("VirtualDirState", Me.Context.Parameters.Item("virtualDir"))
In my Uninstall method, I have a simple windows message box which attempts to display one of these state information (I’m using just a message box in an attempt to debug the problem I’m getting), something like this:
MessageBox.Show(savedState("WebsiteState"))
When I run the Built MSI, the install process works fine. However when I attempt to Remove the web application through the MSI, I get the common ‘NULL reference exception'. I discovered that by adding more than one ‘state’ info (in the install class), causes this NULL reference exception. If I only have ONE state info, the uninstall process works fine (displaying the website value in the message box).
I thought that stateSaver.Add was OK for me to add multiple state information as long as I have a unique key. What’s going wrong?
Your help will be much appreciated.
Regards,
Assad