Thursday, October 30, 2008

Unexpected error 0x8ffe2740 occurred ?

Why do you get this error when you try to start IIS?



The reason is that port 80 (which is used by iis and most other webservers) is taken by some other program. In my case, this was Skype. However, this could be any other p2p or torrent program.

The easiest way out is to stop other programs such as skype, torrent etc, and attempt to start the IIS.

However, there is an option that is available in Skype which keeps skype away from taking port 80. It is, Tools -> options -> Advanced ->Connection-> Use port 80 and 443 as alternatives for incoming connections. Uncheck this option, and skype would no more borrow webserver or sql server default ports…(thanks hethu for the skype tip)

Tuesday, August 12, 2008

Developer Tips and Tricks Blog

I just came across this great blog. This is dedicated for developer tips and tricks and maintained by MS guys.

web developer tips

Session Expiration Problem

I was working on extending the session expiration of a webpage. My requirement was very simple - "Just want to keep the page without session expiring for 2 hours"... Yeah, it's simple - that's the initial thought many programmers would get! I initially thought that just changing the <sessionState> of web.config like below would do the job.

<sessionState timeout="120">

but this didn't solve the problem for me... When I clicked a link in the webpage (that was open for more that 20 minutes) , I was re-directed to the login page. So I had to configure the <authentication> as well.

<authentication mode="Forms">
<forms timeout="120">


Thereafter I changed "Shutdown Worker Processors after being idle for" and "Recycle Worker Process" settings in IIS Application pool.
(In IIS 6, these settings are available at Application Pools => Used application pool => Properties => in Performance tab and in recycling tab)

These IIS changes ensures that the worker processor would not be closed after a given period of time (the default is 20 mins). For instance, we might have a website where the session expiration time is 2 hours, and also authentication expiration time is 2 hours. If we don't change the IIS "Shutdown Worker Processors after being idle for" setting and leave it as the default value "20 minutes", there would be a situation where IIS close the Worker Processor in 20 mins!

So, all these settings need to be configured, to properly set the session expiration time to a large value.