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

  • SEARCH
  • Home
  • 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 5981777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:59:29+00:00 2026-05-22T21:59:29+00:00

Unable to create instance of class TestClass. Error: System.UnauthorizedAccessException: Access to the path ‘C:\Documents

  • 0

Unable to create instance of class
TestClass. Error:
System.UnauthorizedAccessException:
Access to the path ‘C:\Documents and
Settings\Administrator\My
Documents\Visual Studio
2010\Projects\TestProject’ is denied.

System.IO.__Error.WinIOError(Int32
errorCode, String maybeFullPath)
System.IO.FileStream.Init(String path,
FileMode mode, FileAccess access,
Int32 rights, Boolean useRights,
FileShare share, Int32 bufferSize,
FileOptions options,
SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy, Boolean
useLongPath)
System.IO.FileStream..ctor(String
path, FileMode mode, FileAccess
access, FileShare share, Int32
bufferSize, FileOptions options,
String msgPath, Boolean bFromProxy)
System.IO.FileStream..ctor(String
path, FileMode mode)
KM_Automation.KM_Library.GetAutoConfig() in C:\Documents and
Settings\Administrator\My
Documents\Visual Studio
2010\Projects\TestProject\Test_Library.cs:
line 40 KM_Automation.KM_Functional_Trans_General..ctor()
in C:\Documents and
Settings\Administrator\My
Documents\Visual Studio
2010\Projects\TestProject\TestClass.cs:
line 33

Test_Library.cs:

public string[] GetAutoConfig()
{
    FileStream fs = new FileStream(sConfigFile, FileMode.Open);  // line 40
    StreamReader sr = new StreamReader(fs);
    string line = "";
    string[] arrline = new string[2];
}

TestClass.cs:

arrConfig = KMLib.GetAutoConfig(); // line 33

Why am I getting this error? I made sure that the folder is shared to everyone, and removed the Read Only.

  • 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-22T21:59:30+00:00Added an answer on May 22, 2026 at 9:59 pm

    You’re getting this error because as the exception message says the current user doesn’t have access to the file in question. You need to adjust the permissions of that file and it’s parent directories to allow access to the user in question

    Part of the problem is your choice of location. It looks like you are attempting to share a configuration file between a set of users yet you’ve chosen the location of the document to be under the Administrator directory.

    C:\Documents and Settings\Administrator\My Document

    If you want to share amongst users then I would use the All Users or Public directory instead as it’s meant for this type of operation.

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

Sidebar

Related Questions

I get the following error: Unable to create instance of class TestProject.TestClass. Error: System.Runtime.InteropServices.COMException:
Here's the error I'm getting with the code pasted below. Unable to create instance
I am unable to create an empty solution in Visual Studio. The msdn documentation
Why do I get the error: Unable to create a constant value of type
I'd like to create an instance of a class using unity where the class
I know in Java we can create an instance of a Class by new
For my html form, it seems that I'm unable to create cross browser hover
When running wsdl.exe on a WSDL I created, I get this error: Error: Unable
Error: Unable to read data from the transport connection: A blocking operation was interrupted
Python gives us the ability to create 'private' methods and variables within a class

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.