XML- file & network- access

I have a program witch reads a xml file. When i run it in c: it works but when I try it from network it can not read the xml file. I got an IO Permission exception. What do I have to configure?

Thanks!

[510 byte] By [soanfu] at [2007-12-25]
# 1
Have you signed your assembly with a strong name? (right click the project, choose properties and choose the signing tab).
weirdbeardmt at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

I try it in Project Properties to define a new assembly with a strong name. Then I copy myProgram.exe in the Intranet but it does not work? Do I have to do something else?

soanfu at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
When you move the program, are you still trying to read the file from your local hard drive? Or off a network resource? It sounds like the program does not have permission to read the file, which is possibly a network permissions problem. You need to check that the program has valid access rights to the file and check that the path to the file is correct.

If you cannot fix it, I suggest posting the full contents of the exception message.

weirdbeardmt at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4

How can i give the program the access rights? I tried from Project, Properties, Security, FileIOPermission. But with out success!

My exception is:

Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Cultural=neutral,PublickeyToken=b77a5c561934e089.

soanfu at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5

Is that right?

public bool load(string fileName)

{this.fileName = fileName;

try

{ FileIOPermission fp = new FileIOPermission(FileIOPermissionAccess.Read, this.fileName);

PermissionSet ps = new PermissionSet(PermissionState.None);

ps.AddPermission(fp);

XmlTextReader reader = new XmlTextReader(this.fileName);

reader.XmlResolver = new XmlSecureResolver(new XmlUrlResolver(), ps);

xmlDoc.Load(reader);

root = xmlDoc.DocumentElement;

nodeIndex = -1;

element = new XmlNode[3];

return true;

} catch (Exception ex)

{Console.WriteLine(ex.Message);return false;}

}

soanfu at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...