Hi,
I have code in my Business Layer that checks some Session variables. This code should be executed only if a Web app is running. When I access the same method from NUnit, for example, I don't want this code to be executed because session variables are not available.
Does anyone know how to determine in C# code whether or not a Web app is running, or whether or not Session object exists?
if (HttpContext.Current.Session["schema"] != null)
{
// Do something
}
When I run from NUnit, I get the NullReferenceException in the first line.
Thanks in advance for your help.