L
Leo
I am in a dilemma. I am creating a managed code library in C# for use
with ASP.NET. The nature of this library requires me to serialize XML,
and therefore access files. However, I get a security exception when I
call the code in the Dll from the ASP.NET file. Here are the two
methods I call:
public void SetUserDataFilePath(string UserDataFilePath)
{
_path = UserDataFilePath;
}
public void CreateUserFile()
{
_txtWriter = new StreamWriter(_path);
_xmlSerializer.Serialize(_txtWriter, _userTree);
_txtWriter.Close();
}
Now, here is the code i call from the ASP file.
EnterpriseAuthentication ea = new EnterpriseAuthentication();
ea.SetUserDataFilePath("users.xml");
ea.CreateUserFile(); **THIS IS THE LINE THAT THROWS THE
EXCEPTION.
Although I am only pointing to a file within my Application's virtual
directory, it still throws the exception. Please help! I need for my
DLL to be able to access files withing my App's virtual directory.
Thanks, all!
with ASP.NET. The nature of this library requires me to serialize XML,
and therefore access files. However, I get a security exception when I
call the code in the Dll from the ASP.NET file. Here are the two
methods I call:
public void SetUserDataFilePath(string UserDataFilePath)
{
_path = UserDataFilePath;
}
public void CreateUserFile()
{
_txtWriter = new StreamWriter(_path);
_xmlSerializer.Serialize(_txtWriter, _userTree);
_txtWriter.Close();
}
Now, here is the code i call from the ASP file.
EnterpriseAuthentication ea = new EnterpriseAuthentication();
ea.SetUserDataFilePath("users.xml");
ea.CreateUserFile(); **THIS IS THE LINE THAT THROWS THE
EXCEPTION.
Although I am only pointing to a file within my Application's virtual
directory, it still throws the exception. Please help! I need for my
DLL to be able to access files withing my App's virtual directory.
Thanks, all!