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.