Tuesday, May 6, 2008
The initialization code can be put in the the web project's Global.asax.cs:
The Application_Start method is called automatically when the web service is loaded, and thus, it is the ideal place to initialize the log4net environment.
More info on log4net
Friday, May 2, 2008
Type control appwiz.cpl in the Run command window and click OK.
In my case, I needed a shorcut the desktop to the Add/Remove Programs and here are the basic steps:
1. Right-click on the desktop
2. Select New -> Shortcut
3. In the Create Shorcut window, enter control appwiz.cpl and click Next.
4. In the Select a Title for the program, enter a descriptive name and click Finish.
And if the shortcut icon is a big ugly, then you can change it as well from the shortcut properties window.
Set the Text property of a Label with a string literal having ampersand (&) characters. When the application is run, the ampersand character is not displayed in the label.
The default behaviour of Labels interprets ampersand characters (&) in the Lanel control's Text property as an access key prefix character, and not as a character literal.
To escape the ampersand character, I will suggest two ways.
1. Use double ampersand. However, this modifies the original string literal, which you probably don't want.
2. Set the Label.UseMnemonic Property to false (since by default, value for the UseMnemonic property is true).
More information on Label.UseMnemonic Property on MSDN
Thursday, May 1, 2008
An .installstate file is not removed after you uninstall a .NET Framework 2.0-based application
Since the Workarounds suggested in the article didn't make much sense to me, I have found another way to solve it.
the same custom action (that was initially used for Install custom action) to the Uninstall custom action.
Then, Override the Uninstall method in the installer class and make sure it calls the base Uninstall method.
Redirecting an Application to Target a Different XML Web Service During Installation
That's exactly what I needed and it just took me just a couple of minutes to code it in C#.
I think it won't be a big deal to complete the last part ... :-) Is it?
SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
I encountered this error when attempting to start a project's exe file compiled under the Release configuration.
Analysis & Observations
The exe file compiled under the Debug configuration started without any problem and there were no error messages or exceptions.
Starting the Release version from Visual Studio (though F5 - start debugging), it worked fine as well.
The Main() function had the Application.SetCompatibleTextRenderingDefault method call in the second line before the Load method call. So, this should be working fine.
The application configuration file has been renamed deployed.
When starting the exe, the process shows for a second in the Task Manager and then disappears (which is not what I expected).
There is no pragma code or conditional compilation sections in the code that may not execute when running in Release Mode.
After all these observations and some further investigation in the code, I have finally found the real problem. The MainFormController is a singleton and had a Form as an instance member. This form was being instantiated when the class was being loaded in the memory, well before the Application.SetCompatibleTextRenderingDefault and Load method calls.
I have changed the code to lazy initialization of the form, and thus, the form will be instantiated only when it is requested for the first time. Wohoooooo.