Hari
Hari

Reputation: 49

How to Grant Permissions to Folder on Network , vs 2008 framework 3.5

I'm using Visual Studio 2008 on my local PC. My Code kept on network Drive. when i am trying to run it from my local machine i am getting below security exception.is there anyway i can Grant Permissions to network folder?

*Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.*

Upvotes: 0

Views: 664

Answers (1)

Nicole Calinoiu
Nicole Calinoiu

Reputation: 20992

You have a few options, including but not limited to:

  1. Upgrade your project to .NET 3.5, and ensure that you have .NET 3.5 SP1 installed on your local machine (http://blogs.msdn.com/b/shawnfa/archive/2008/05/12/fulltrust-on-the-localintranet.aspx).
  2. Change your local CAS policy to grant full trust to assemblies in the network location where you are storing your code. (http://msdn.microsoft.com/en-us/library/2bc0cxhc(v=vs.80).aspx)
  3. Avoid using whatever it is that is requiring AspNetHostingPermission. (If you share what this is, it might be possible to suggest an alternative.)

Personally, I would opt for moving the code to the local machine for development for reasons that go beyond the CAS permissions problem, but ymmv...

Upvotes: 1

Related Questions