Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top