IIS Web Service Extensions

Yesterday at work one of my colleques tried to publish a new asp.net application on windows 2003 server on IIS V6.0. The application was a plain ASP.Net 2.0 written in C#. Nothing fancy. To his amazement while the application worked fine locally it always displayed page not found on the server. He bagan troubleshooting and created a test html webpage which he can see on the browser. However still couldn’t see test.aspx.

He tried re-registering asp.net using aspnet_regiis.exe. Restarted the machine, but no still gets Page Not Found on aspx pages. Then he asked me if I have any ideas why this could be happening. I remembered how I once had the same issue while installing an asp.net application on a brand new windows 2003 server. I asked him to check his IIS Web service extensions. Turns out the asp.net was prohibited at web server. Here are the steps that are required to enable asp.net

  1. In IIS Manager, click the Web Service Extensions folder
  2. In the details pane, select the Web service extension that you want to enable, and then click Allow
  3. To see the properties of a Web service extension, select an extension, and then click Properties

Please see the image for more information.

Web Service Extensioins in IIS

Web Service Extensioins in IIS

Commons Logging

There are a lot of powerful logging libraries available for .net. Among them Microsoft Enterprise library logger, nLog and log4net are really popular and easy to use. Developers still try to write their own and customise these available helpers too. However the purpose of this post is how we can use Commons logging implementation to decouple logging library implementation from our application. Using commons logging allow the application to change to a different logging implementation without recompiling code.

Note: that commons logging does not attempt to initialise or terminate the underlying logging implementation that is used at runtime; that is the responsibility of the application. However many popular logging implementations do automatically initialise themselves; in this case an application may be able to avoid containing any code that is specific to the logging implementation used.

Normally we tend to initialise our loggers in the application code directly, thereby creating a code dependency forever unless we decide to remove each line to code. All the existing logging mechanisms do not come with a common interface. However the solution is much easier. And there is an existing .Net library that does the job for us. I found it at sourgeforge.net. Please follow the link below

http://sourceforge.net/projects/netcommon/

It is really easy to use with log4net and common logging solution. Do note that you still need to configure the log4net in your configuration files as you would have normally done and need to also include a new section in your web.config/ appsettings file to direct the Common.Logging API.

Posted in .net, log4net. Tags: . Leave a Comment »