This is probably happening because WCF doesn't use the ASP.NET infrastructure.
There's probably another way to get the same information (assuming that your service happens to have an application path - that concept only makes sense for services hosted in IIS).
kahanu
Member
90 Points
147 Posts
HttpContext.Current.Request.ApplicationPath - Object Reference not set to instance of an object
Feb 12, 2009 06:58 AM|LINK
I'm trying to get the application path using this class in a class project that is being referenced by a WCF service being called in an ASPX page.
Web Site Application (not web site file system)
|
|
V
WCF Service
|
|
V
Class Project
Method calls System.Web.HttpContext.Current.Request.ApplicationPath <-- Object Reference not set to an instance of an object
Any ideas why this is happening?
Thanks.
MVC Central
http://www.mvccentral.net
johnwsaunder...
Star
11262 Points
1981 Posts
Re: HttpContext.Current.Request.ApplicationPath - Object Reference not set to instance of an obje...
Feb 12, 2009 12:37 PM|LINK
This is probably happening because WCF doesn't use the ASP.NET infrastructure.
There's probably another way to get the same information (assuming that your service happens to have an application path - that concept only makes sense for services hosted in IIS).