S
shapper
Hello,
In have a class inside a compiled DLL where I have the following code:
' Create site map XML document
Dim siteMap As XmlDocument = New XmlDocument
' Load site map XML document from ASP.NET web site map
siteMap.Load(HttpContext.Current.Server.MapPath(Me.SiteMapUrl))
Me.SiteMapUrl is a property.
In my web site I use this class and I set Me.SiteMapUrl =
"~/Web.sitemap".
When I run the page I get an error saying:
"System.UnauthorizedAccessException was unhandled by user code
Message="Access to the path 'C:\Documents and Settings\User\My
Documents\Visual Studio 2005\WebSites\MyWebSite' is denied."
I went to MyWebSite folder Security and gave Full Control to:
ASP.NET Machine Account (SHAPPER\ASPNET)
and
Internet Guest Account (SHAPPER\IUSR_SHAPPER)
I keep having the same error.
I tried everything I could think off but I was not able to solve this.
Could someone tell me how to solve this?
Thanks,
Miguel
P.S: Here is my full error detail.
"System.UnauthorizedAccessException was unhandled by user code
Message="Access to the path 'C:\Documents and Settings\User\My
Documents\Visual Studio 2005\WebSites\MyWebSite' is denied."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode,
FileAccess access, Int32 rights, Boolean useRights, FileShare share,
Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs,
String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String
role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object
xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack
compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader,
Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at By27.Web.UI.Footer.by27f_pSiteMap_Init(Object sender,
EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32
index)
at System.Web.UI.ControlCollection.Add(Control child)
at By27.Web.UI.Footer.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
In have a class inside a compiled DLL where I have the following code:
' Create site map XML document
Dim siteMap As XmlDocument = New XmlDocument
' Load site map XML document from ASP.NET web site map
siteMap.Load(HttpContext.Current.Server.MapPath(Me.SiteMapUrl))
Me.SiteMapUrl is a property.
In my web site I use this class and I set Me.SiteMapUrl =
"~/Web.sitemap".
When I run the page I get an error saying:
"System.UnauthorizedAccessException was unhandled by user code
Message="Access to the path 'C:\Documents and Settings\User\My
Documents\Visual Studio 2005\WebSites\MyWebSite' is denied."
I went to MyWebSite folder Security and gave Full Control to:
ASP.NET Machine Account (SHAPPER\ASPNET)
and
Internet Guest Account (SHAPPER\IUSR_SHAPPER)
I keep having the same error.
I tried everything I could think off but I was not able to solve this.
Could someone tell me how to solve this?
Thanks,
Miguel
P.S: Here is my full error detail.
"System.UnauthorizedAccessException was unhandled by user code
Message="Access to the path 'C:\Documents and Settings\User\My
Documents\Visual Studio 2005\WebSites\MyWebSite' is denied."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode,
FileAccess access, Int32 rights, Boolean useRights, FileShare share,
Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs,
String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String
role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object
xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack
compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader,
Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at By27.Web.UI.Footer.by27f_pSiteMap_Init(Object sender,
EventArgs e)
at System.Web.UI.Control.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32
index)
at System.Web.UI.ControlCollection.Add(Control child)
at By27.Web.UI.Footer.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)