System.Security.Permissions.FileIOPermission in 2.0 Framework.



Hi there,

I have a Windows application that I'm running from a shared drive that
needs to access file/directory resources on other drives. I've done a
lot of reading, but a lot of the material out there relates to the 1.1
Framework as opposed to 2.0.

I've added the following lines to my AssemblyInfo.vb:
<Assembly: System.Security.AllowPartiallyTrustedCallers()>
<Assembly: System.Security.SecurityTreatAsSafe()>
<Assembly: AssemblyKeyFile("fish.snk")>

I've enabled ClickOnce Security settings to be full trust, although
that is not how I deploy the application (it's a one file Windows app,
so I just xcopy).

I've signed the assembly from within the IDE, using the name referenced
in the AssemblyInfo file.

I've evaluated the assembly using the .Net 2.0 Framework Configuration
tool: all levels, unrestricted.

I even installed the .Net Framework SDK on the machine on which the
code sits and created a new Code Group at the Enterprise level. The
membership condition is the imported Strong Name from my assembly, and
I've also selected "The policy level will only have permissions from
permission set associated with this code group." and "Policy levels
below this level will not be evaluated." I assigned this code group
the "Full Trust" permission set.

My code attempts to read a text file from a non local directory and is
called from a shared drive. I get this error message:

The action that failed was: Demand
The type of the first permission that failed was:
The Zone of the assembly that failed was: Intranet

I'm really struggling with this problem which I'm sure is really
simple. I'm hoping someone can lend me a hand because I must have
missed something pretty elementary to still be having an issue. Any
help will be much appreciated. :)




Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question