By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

Can't Write File on Hosted Server...

P: n/a
The application is a simple form of three textbox controls that results
in writing an XML file to the file system of the application root when
it runs on the local development machine.

I've just used FTP to deploy this as my first ASP.NET application using
a hosting provider using W2003 IIS6 noting the host provides a control
panel that allows me to set the application root as a virtual application.

The XML file is not being created and the application bombs out.
I have no idea how to respond to the error message that follows...

<errorStart>
Exception Details: System.UnauthorizedAccessException: Access to the path
"c:\xxx\xxx\xxx\csgallagher\xxx\SomeFile.xml" 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.
</errorEnd>

Using the hosting control panel I tried giving ASPNET full permission on
the application's folder. No joy. I tried adding <identity
impersonate="true"/>
to the web.config but learned it results in a challenge for credentials. I
used
my account credentials which were refused confusing me even further as
the error message indicates using impersonation as noted used the identity
of
the anonymous IUSR_MACHINENAME user account.

I have no idea what to try next.
--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Authentication for write permissions can be a tricky thing in a hosted
environment, if you have been given write permissions at all.

I would guess that the hosting provider denies write at some point in the
path
"c:\xxx\xxx\xxx\csgallagher\xxx\SomeFile.xml" is denied.
at a level below your application.for the asp.net account, so even
impersonation is unlikely to help as you have found.

Your next step is probably to drop them an email outling the problem, even
passing them a small code sample. If they are any good as a hosting
provider they will be able to tell you straight away what the problem is and
resolve it for you.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:uK*************@TK2MSFTNGP15.phx.gbl...
The application is a simple form of three textbox controls that results
in writing an XML file to the file system of the application root when
it runs on the local development machine.

I've just used FTP to deploy this as my first ASP.NET application using
a hosting provider using W2003 IIS6 noting the host provides a control
panel that allows me to set the application root as a virtual application.

The XML file is not being created and the application bombs out.
I have no idea how to respond to the error message that follows...

<errorStart>
Exception Details: System.UnauthorizedAccessException: Access to the path
"c:\xxx\xxx\xxx\csgallagher\xxx\SomeFile.xml" 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.
</errorEnd>

Using the hosting control panel I tried giving ASPNET full permission on
the application's folder. No joy. I tried adding <identity
impersonate="true"/>
to the web.config but learned it results in a challenge for credentials. I
used
my account credentials which were refused confusing me even further as
the error message indicates using impersonation as noted used the identity
of
the anonymous IUSR_MACHINENAME user account.

I have no idea what to try next.
--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

Jul 21 '05 #2

P: n/a
Thank you John. The host provider has been very responsive and just notified
me to explain they had to apply permissions for the Network Service account
byut didn't explain if that was applied to the root of the account to enable
permissions to propagate or if the permissions were applied to the
application root of the virtual application so one more round opf tech
support %-)

Got to read more about Code Access Security and just found this...

MSDN - Hosting Multiple ASP.NET Applications
http://msdn.microsoft.com/library/de...l/secmod93.asp

<%= Clinton Gallagher


"John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message
news:Od**************@TK2MSFTNGP12.phx.gbl...
Authentication for write permissions can be a tricky thing in a hosted
environment, if you have been given write permissions at all.

I would guess that the hosting provider denies write at some point in the
path
"c:\xxx\xxx\xxx\csgallagher\xxx\SomeFile.xml" is denied.
at a level below your application.for the asp.net account, so even
impersonation is unlikely to help as you have found.

Your next step is probably to drop them an email outling the problem, even
passing them a small code sample. If they are any good as a hosting
provider they will be able to tell you straight away what the problem is and resolve it for you.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:uK*************@TK2MSFTNGP15.phx.gbl...
The application is a simple form of three textbox controls that results
in writing an XML file to the file system of the application root when
it runs on the local development machine.

I've just used FTP to deploy this as my first ASP.NET application using
a hosting provider using W2003 IIS6 noting the host provides a control
panel that allows me to set the application root as a virtual application.
The XML file is not being created and the application bombs out.
I have no idea how to respond to the error message that follows...

<errorStart>
Exception Details: System.UnauthorizedAccessException: Access to the path "c:\xxx\xxx\xxx\csgallagher\xxx\SomeFile.xml" 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.
</errorEnd>

Using the hosting control panel I tried giving ASPNET full permission on
the application's folder. No joy. I tried adding <identity
impersonate="true"/>
to the web.config but learned it results in a challenge for credentials. I used
my account credentials which were refused confusing me even further as
the error message indicates using impersonation as noted used the identity of
the anonymous IUSR_MACHINENAME user account.

I have no idea what to try next.
--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.