Monthly Archives: April 2011

WCF – ____ is already defined.

This drove me crazy for a several hours. Turned out the solution was simple. Again MS has limitations that don’t allow combinations of input / output. YOu have either use wrappers or no wrappers. It seems like I have seen implementations where this limit did not exist, but putting wrappers (reauest / response) around my new entry points fixed the issue.

More info at stack overflow:

wcf – Add Service Reference “___ is already defined”a – Stack Overflow

 

Advertisements

Aspx Session timeout

We recently had an issue with users clicking on a data entry form and losing data. They had previously had this happen once in a while, but now it was happening a lot. We investigated and suspected that it had to do with session. We just changed our data entry form to ecah get its own session because session shares data across tabs and windows (something I did not know until about a month ago). So to keep the data all properly separate, we implemented cookieless sessions. This way when we accessed a page using a full URL (not relative), it would get a new session and thus it own session data space. This worked great, but sessions started timing out (we found out) and then users would enter their data and upon the first call back to the server the page would be refreshed instad of performing an update.

It turns out session is set to a default of 20 minutes. We looked in the IIS settings and we were able to set session to a higher number there, but low and behold it still timed out! I then checked the configuration. There was no explicit setting, just the CookielessSession setting that we had added:

<sessionState cookieless=”true” regenerateExpiredSessionId=”true” />

Apparently even though we had not set the timeout, the presence of this configuration setting caused it to default from the configuration (can someone verify this?). Once we added the timeout setting, the session tie was extended:

<sessionState cookieless=”true” timeout=”90″ regenerateExpiredSessionId=”true” />

There is also a setting in the application pool that must be watched. This setting is used to kill app pool threads oncethe time has expired from inactivity in the pool. For our purposes, this is not an issue as there is lots of activity to keep it alive, but it could be important to make sure this is opened wide enough to serve you.

Some of the useful links I found in this exercise:

How to increase session timeout to 8 to 9hrs? : The Official Microsoft ASP.NET Forums

Session timeout in ASP.NET – Stack Overflow

Session-State Modes