Archive for July, 2010

best practice when developing asp.net web application

1. Protect private configuration in app.config / web.config

http://msdn.microsoft.com/en-us/library/68ze1hb2(VS.80).aspx

e.g. http://msdn.microsoft.com/en-us/library/system.configuration.rsaprotectedconfigurationprovider(v=VS.80).aspx

2. SetT RETAIL=”TRUE” in machine.config

<configuration>
<system.web>
<deployment retail="true"/>
</system.web>
</configuration>

Reference:
http://www.education.vic.gov.au/devreskit/appdev/standards/asp/aspnet-standards-summary.htm

http://daptivate.com/archive/2008/02/12/top-10-best-practices-for-production-asp-net-applications.aspx

No Comments

IIS Failed to start / removal in Windows Server 2008

IIS 7 failed to uninstall in Windows Server 2008 if the WAC, Windows Process Activation service, is corrupted and failed to start. The problem is due to corrupted C:\Windows\system32\inetsrv\config\applicationHost.config .

After googling, I have found the post useful, http://www.gringod.com/2008/08/15/when-iis-wont-start-error-13/

Debugging step 1: Look in the windows services list and see if I can manually start the service. This was a little more helpful as it told me it couldn’t start due to a dependency not starting.

Debugging step 2: Check the service dependencies. It appears that the Windows Process Activation service (WAS) wouldn’t start, although it only returned the message “Error 13: The data is invalid”.

Debugging Step 3: Check the system event log. Here I found the most helpful message so far:

The Windows Process Activation Service encountered an error trying to read configuration data from file ‘C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ‘0′. The error message is: ‘Configuration file is not well-formed XML’. The data field contains the error number.

It seems that at some point the applicationHost.config got trashed. Luckily, when you make changes to web applications in IIS it creates a backup of the applicationHost.config file in c:\inetpub\history. All you need to do is copy a good copy from the history and put it into c:\windows\system32\inetsrv\config.

And Roberts your mothers brother, WAS starts, IIS starts and the repair of SharePoint can continue!

ps. I’m running IIS7 on Windows 2008 Server.

Ref: http://www.gringod.com/2008/08/15/when-iis-wont-start-error-13/

No Comments

Sharepoint / WSS Cannot Open Picture Manager

The problem maybe due to the “managed path” or the “URL Mapping” of the site.

Usually some deployment map another URL to the same machine using DNS, however, usually the mapping setting in sharepoint is missed.

Please ensure the URL using is managed in Central Administration Site > Operation > Alternate Access Mapping.

To edit the public URL , press “Edit Public URL” button, and enter all the URL will be used to access the site.

No Comments