Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:15:07+00:00 2026-05-18T20:15:07+00:00

everyone. I’m developing a small ASP.NET Mvc project in Mono 2.4, Ubuntu 10.10. There

  • 0

everyone. I’m developing a small ASP.NET Mvc project in Mono 2.4, Ubuntu 10.10. There is an array of objects, each one of them corresponds to a certain xml file. Reading of the xmls is performed with XmlTextReader. That does not work because xml files have rare “cp866nav” encoding, which is not supported by XmlTextReader (“System.ArgumentException: Encoding name 'cp866nav' not supported“). But it works fine if encoding in xml header is changed to “cp866”. I found a kind of solution which consists in initializing XmlTextReader with a StreamReader with a certain encoding instead of file name, like in the code below:

XmlTextReader reader = new XmlTextReader(new StreamReader(Server.MapPath(filename), Encoding.GetEncoding("cp866")));

The issue is that the directory which contains xml files is read only (I can not change it), so I get
“System.UnauthorizedAccessException: Access to the path '' is denied.“. Rather strange, because XmlTextReader initialized with a filename seems to read the files.

Is there any solution, considering that program cannot modify or create files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:15:08+00:00Added an answer on May 18, 2026 at 8:15 pm

    As your problem is with file access rather than encoding I’d recommend trying to open file as stream yourslef with correct flags FileStream(name, FileMode.Open, FileAccess.Read) and then calling the other constructor StreamReader that takes Stream.

    (Don’t forget to dispose stream/readers when you are done).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

everyone. I'm developing a small ASP.NET Mvc project in Mono 2.4, Ubuntu 10.10. There
everyone! I'm confusing with implementing a piece of code to make work .net data
everyone. Here is a small VBA (Excel) function that i wrote, full of MsgBoxes
everyone, I've started working yesterday on the Euler Project in Clojure and I have
everyone! I am new for C++ and now work on a C++ project.The whole
Everyone always says to profile your program before performing optimizations but no-one ever describes
Everyone is saying how .NET Remoting is being replaced by WCF, but I'm wondering
everyone; I am working on a database where path information are stored, one simplified
everyone, I have faced one problem: The ZUL code: <window title=Hello World!! id=winMain border=none
Everyone, Apologies for the simplicity. I'm using PHP and XML for a quick one-off,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.