> No, a program that is loaded from a local drive runs at "full trust" by
default. That means that the "code" already runs with FileIOPermission no
matter the location of the file, the CAS security doesn't care about the
location, unless the OP explicitly denied access to the remote file or
directory, something I guess he didn't do.
Odd, if I understand your argument, then it means that if I start up a .NET
program locally on my C: drive then CLI does not prevents me from accessing
a shared network file by default way?
I mean suppose, take a default Windows installation, create a default C#
form with a button to open a file, and it will, without protest open a
shared file when I start up the program on my C: drive?
Either something changed between .NET v1.0 to v1.1 or my tests here are
wrong, since it took me the hell of a time to find out how to make an
installer that automatically makes my program, installed locally to open a
shared folder witout complaint.
Maybe we are talking about the same thing here but somehow have a
communication problem.
Here my last try:
The program have the programmers .NET *permission* to open a shared folder
file, but the administrator of that local machine might have a .NET *policy*
not to let that program do that.
And I was always convinced that the default .NET installation has it's
*policy* never to allow a .NET program, even run locally have access t a
shared network folder/file by default.
You must activate this exceptional *policy* access by telling the .NET
framework to let the program with this key signature and maybe including
this version info to grant access to open a shared folder/file.
through this: "Control panel->Administrative Tools->Microsoft .NET Framework
1.1 Wizards->Trust an assembly"
Changing the global default trust is not a wise choice.
But since this is a scary thing for most users, this could be done
automatically through a setup project which is a pure unmanaged program, and
have thus rights to access the using a custom installer inherited from
System.Configuration.Install.Installer
[RunInstaller(true)]
public class Installer1 : System.Configuration.Install.Installer {
...
}
Willy were we talking about the same thing?
Or am I completely and officially confused? ;-)
I agree with you, it could be plain old Windows network access rights, but
my bet is on the .NET policy thing since this is new and newbie programmers
all fall for this one.