0

I've got a solution in a folder on my Host machine. (This folder is available to the vm)

With the sln open in VS, when I hit F5, the browser loads, but I get a secuirty exception:

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.

Any ideas how to fix this so I can debug / run the app in casini on my VM?

Steve B
  • 34,941
  • 18
  • 92
  • 155
Alex
  • 34,123
  • 47
  • 189
  • 315

1 Answers1

1

Copy the solution to your VM local hard drive.

In fact, you are trying to run the solution from a network share (at least Windows see the folder as this). And .Net have the Code Access Security feature (CAS) that, by default, forbid a lot of things for programs in network folders.

Another solution would be to change the CAS policy, but it can be a bit of pain.

Steve B
  • 34,941
  • 18
  • 92
  • 155
  • Copying the sln to my VM local hard drive isn't an option really... How do i change the CAS policy? – Alex Jul 22 '12 at 08:36
  • here is a starting place : [Configuring Security Policy Using the Code Access Security Policy Tool (Caspol.exe)](http://msdn.microsoft.com/en-us/library/a0ke3k86.aspx) – Steve B Jul 22 '12 at 20:21
  • It's painful that Microsoft remove this in the .Net Framework V4 – Steve B Oct 25 '12 at 12:01