c# - Could not load type "System.Web.HttpContext" from assembly "System.Web" -


system.typeloadexception: not load type 'system.web.httpcontext' assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'.

using system; using system.collections; using system.collections.generic; using system.web; using system.xml.linq;  public class example :  { xdocument doc = xdocument.load(system.web.httpcontext.current.server.mappath("~/example.xml")); } 

of course, if not in web application, no way can use httpcontext.current !

you can check if system.web.httpcontext.current null or not, it's available in web pages or web services.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -