Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > UnauthorizedAccessException when reading XML files (no problem when reading other file-types)

Reply
Thread Tools

UnauthorizedAccessException when reading XML files (no problem when reading other file-types)

 
 
blabla120@gmx.net
Guest
Posts: n/a
 
      09-15-2006
Hi NG,

I want to read a xml-file from an asp-page:

// Kategorien aus xml laden
string pathKategorien =
Server.MapPath("./conf/kategorien.xml");
FileStream fs = new FileStream(pathKategorien, FileMode.Open,
FileAccess.Read, FileShare.ReadWrite);
StreamReader sr = new StreamReader( fs );
XmlSerializer s = new XmlSerializer( typeof( Kategorien ) );
_kat = (Kategorien)s.Deserialize( sr );

I get the Exceptio "UnauthorizedAccessException".

But I am sure that the Access rights are properly set, becaus it is no
problem to read a text-File from the same folder:

string pathKategorien = Server.MapPath("./conf/textfile.txt");

So I suppose there must be something special about XML-file concerning
file access rights.

Does anyone have a hint for me?

Thanx, Bernd

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.UnauthorizedAccessException: Access to the path ...Temporary ASP.NET Files.. is denied. Anbu ASP .Net 4 03-09-2006 06:00 AM
UnauthorizedAccessException in webservice accessing files on UNC s Robert Altland ASP .Net Security 0 09-15-2005 10:20 PM
Visual Studio throws UnauthorizedAccessException when debugging R Warford ASP .Net 3 12-01-2003 04:08 PM
System.UnauthorizedAccessException: Access is denied. Salim Af■ar ASP .Net 0 08-11-2003 12:10 PM
Re: System.UnauthorizedAccessException: Access to the path <file> is denied. (framework 1.1) S. Justin Gengo ASP .Net 0 07-14-2003 02:00 PM



Advertisments