We recently converted a web site to web application. Everything works perfectly when we deploy. If we allow the application to shut down (i.e. no one uses it for 1 hr), then when we go back to it, the Login page loads fine, but then calls to Web Services (old SOAP services) fail. This does not repro in dev environment, only on our servers.
Where we tracked some issues down, it appears that one or more strings were not initialized before they were used, resulting in empty or null strings that blow things up.
One thing that really pains us is that Log4Net logging stops totally; so tracking down issues require significant kludging code.
Any idea of the root cause (and hopefully a fix)
========UPDATE=========
One of the issue tracked down to an interesting situation…
The service call that failed produced "It must at least specify the Client property." This is set by this
profile.Client = ApplicationName;
public static string ApplicationName
{
get
{
return string.Format(CLIENTNAME, Resources.AppVersion.Version);
}
}
Which calls:
internal static string Version
{
get
{
return ResourceManager.GetString("Version", resourceCulture);
}
}
Conceptually, it should never fail if it worked once.
Another issue was Log4net not working when the web application reloads, where we also encountered static
private static readonly ILog ExceptionLog = LogManager.GetLogger("ExceptionLogger");
private static readonly ILog SoaLog = LogManager.GetLogger("soaPerfLogger");
private static readonly ILog InfoLog = LogManager.GetLogger("InfoLogger");
private static readonly ILog DebugLog = LogManager.GetLogger("DebugLogger");
The apparent cause seems to be static variables nulling on the restart of the Web Application. They are not being reinitialized.
Awaiting brilliant suggestions! Otherwise, I will be slugging thru all of the 852 static usages in the code to add code to address this unusual behavior.