Showing error message with C # AfterInstall Event

Can someone please tell me how to display an error message in C # while running AfterInstallEvent?

My project uses a Microsoft Install and Deployment project and then I created a class that is called when the AfterInstall event is fired.

MessageBox.Show (); doesn't work ... "The name" MessageBox "is not displayed in the current context."

If it were that simple, I wouldn't ask !?

+1


source to share


2 answers


The real solution is to use the area. Something like this: global :: System.Windows.Forms.MessageBox.Show (eg "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);



Greetings

+2


source


This is very old, but I will answer anyway:

This is just a missing link.



Add a reference to System.Windows.Forms in the project containing the class. Also add "using System.Windows.Forms;" to the top of your class file.

As far as I know, there should be no problem displaying the messageboxes from a custom install action.

+1


source







All Articles