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

Access to the denied error

P: n/a
Running Windows 2000 Server here. My ASP.NET app reads an XML file (in
the virtual root on the local machine) like this just fine:
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("feeds.xml"),XmlReadMode .InferSchema);

The problem is when I upload it to my host I get a
System.Security.SecurityException when trying to read the XML file. But
you've heard this all before. So I thought I'd try replacing the
dataset reader with a FileStream like this:
DataSet ds = new DataSet();
FileStream fs = new FileStream(Server.MapPath("feeds.xml"),
ds.ReadXml(fs, XmlReadMode.InferSchema);
So now it gives me, on my local machine, an "Access to the
denied" error?!

Same directory, same XML file, one has access and the other does not.
Can you explain this???

I am not impersonating in web.config.

Many people might suggest changing folder and file permissions. That's
fine, except when it comes to my hosting company. I can't access these
things there.

There's just gotta be a way to change security setting in the
web.config, but I can't figure how.

Does anyone know how to fix any of these errors?

Thanks for your help.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Never mind. I fixed it. And you would never guess how so I'll tell

Apparently at my hosting company new ASP.NET are, by default, configured
for the 1.0 Framework. I found an option in the host control panel to
upgrade a site to 1.1. After doing this everything works fine. Who
woulda thunk it?
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.