Now for the error:
Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\MySite" is denied.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the
boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[UnauthorizedAccessException: Access to the path "C:\Inetpub\MySite" is
denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) +888
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share) +45
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials) +73
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type
ofObjectToReturn) +55
System.Xml.XmlTextReader.CreateScanner() +384
System.Xml.XmlTextReader.Init() +23
System.Xml.XmlTextReader.Read() +530
System.Xml.XmlValidatingReader.ReadWithCollectTextToken() +146
System.Xml.XmlValidatingReader.Read() +26
System.Xml.XPath.XPathDocument.Load(XmlReader reader) +116
System.Xml.Xsl.Compiler.LoadDocument(XmlTextReader reader) +105
System.Xml.Xsl.XslTransform.Load(String url, XmlResolver resolver) +144
System.Xml.Xsl.XslTransform.Load(String url) +26
Wulfe.MySite.Web.Controls.Server.Navigator.Render(HtmlTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
+44
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +263
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Page.ProcessRequestMain() +1929
Now for what I have tried:
First, permissions... already tried that and currently have it set to a
ludicrous Everyone Full, I have also added ASPNET account to Administrators
in a desperate attempt to fix this problem. I have added Local Service,
Network Service, and IIS_WPG to the NTFS security and given full control to
each. I have it set within IIS to allow writes. I have even setup of web
sharing with writes allowed.
I have left web.config and machine.config at default and am not
impersonating, although I did try setting it to true and used a service
account with administrative rights and proper user rights
I have assigned the site to it's own Application pool and have it currently
set to run as local system after trying Network and Local service, as well
as a service account added to the IIS_WPG group.
I have allowed server side includes as well as all of the custom .dll's that
I am using within Web Extensions. Then set Allow everything.
After all this, I am glad this is in a test environment and not on the net.
Now for the code:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Xml
Imports System.Xml.XPath
Imports System.Xml.Xsl
Namespace ThePhile.Web.Controls.Server
Public Class Navigator
Inherits System.Web.UI.Control
Private myTransformFilePath As String
Private mySourceFilePath As String
Public Property Transformfile() As String
Get
Return myTransformFilePath
End Get
Set(ByVal Value As String)
myTransformFilePath = Value
End Set
End Property
Public Property SourceFile() As String
Get
Return mySourceFilePath
End Get
Set(ByVal Value As String)
mySourceFilePath = Value
End Set
End Property
Protected Overrides Sub Oninit(ByVal myEvent As EventArgs)
MyBase.OnInit(myEvent)
End Sub
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
Dim xDoc As New
XPathDocument(Context.Server.MapPath(mySourceFilePath))
Dim xslt As New XslTransform()
With xslt
.Load(Context.Server.MapPath(myTransformFilePath))
.Transform(xDoc, Nothing, writer)
End With
End Sub
End Class
End Namespace
Now for my plea:
If anyone could please give me an honest answer without referring to a doc
that doesn't answer the question, I would really appreciate it. After this
stint and banging my head for two and a half days, I am ready to go back to
IIS 5 and quite possibly ASP.
I would recomend you try an ASP.NET newsgroup.
Gregg
--------------------
>From: "Winston Harrington" <wharr...@attbi.com>
>Newsgroups: microsoft.public.vsnet.debugging
>Subject: System.UnauthorizedAccessException: Access to the path "C:\Inetpub\MySite" is denied.
>Lines: 137
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Message-ID: <WgQCa.839124$Zo.175408@sccrnsc03>
>NNTP-Posting-Host: 12.237.46.228
>X-Complaints-To: ab...@attbi.com
>X-Trace: sccrnsc03 1054593206 12.237.46.228 (Mon, 02 Jun 2003 22:33:26 GMT)
>NNTP-Posting-Date: Mon, 02 Jun 2003 22:33:26 GMT
>Organization: AT&T Broadband
>Date: Mon, 02 Jun 2003 22:33:26 GMT
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.stealth.net news.stealth.net!news.stealth.net!
204.127.161.156.MISMATCH!wn12feed!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail
>Xref: cpmsftngxa06.phx.gbl microsoft.public.vsnet.debugging:2471
>X-Tomcat-NG: microsoft.public.vsnet.debugging
--
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm