March 2009


If you a try to host a service in Windows Vista, you will receive an AddressAccessDeniedException. It is because of overly secured environment of the Windows Vista.

You will receive an error stating

HTTP could not register URL http://+:8000/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

You get this error because the owner of the http publishing is the built in administrator and you will not be running with administrator privileges.

You have to add the HTTP namespace to your user account. For that run the Command Prompt as an Administrator and run this command:

netsh http add urlacl url=http://+:8000/ user=DOMAIN\UserName 

You can more details here

To start a thread with a method having parameters, one cannot use the traditional way of starting a thread.

The best way is to use a Anonymous Delegate to start a thread.

Here’s the sample:

MyParameteredMethod is my method which accepts 3 parameters. I wish to start this method in a new thread.

MyParameteredMethod is my paramet
ThreadStart ts = delegate() { MyParameteredMethod(param1, param2, param3); };
Thread t = new Thread(ts);
t.Start();