but the problem is i have got MyCompany.MyProject.Security.dll reference in
MyCompany.MyProject.WebUI.dll which is the right way i guess because
Security's services will be consumed by WebUI..... it is however in Security
that i need to access the session object.
the error that i get at compile time is that 'The name 'HttpContext'' does
not exist in the current context", which is true since Security is another
project.
can i access the httpcontext object without passing it as an argument to a
class in Security component??
"Karl Seguin [MVP]" <ka********@removeopenmymindremovemetoo.andmenetwr ote
in message news:37**********************************@microsof t.com...
>
which should be avoided when possible, but obviously isn't always.
at the very least you could do a null check:
if (HttpContext.Current == null)
{
//either fallback to something or throw some exception
//throw new NotImplementedException("This function can only be called
within a webrequest-context for now");
}
Don't remember if you need to reference System.Web.dll, I'd assume so.
Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:uW*************@TK2MSFTNGP05.phx.gbl...
>HttpContext.Current
George
"Sami Rehman" <sa*********@4D.orgwrote in message
news:eB**************@TK2MSFTNGP04.phx.gbl...
>>hi
i have a vs solution in which there are 2 projects
class library representing Security services and another one is web
application project.
i need to access http context in a static method in a class of Security
Services project.
how can this be done.
thanks
-sami