So what do you do if you come across this error in Visual Studio?
System.Security.SecurityException: Request for the permission of type ‘System.Web.AspNetHostingPermission, System, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.
The error typically occurs when you download files from an external source into your Visual Studio project. Windows will recognise the file came from an external source and restrict permissions.
You can resolve this by viewing the file Properties for the offending file in Windows Explorer and clicking the “Unblock” button.
So what happens if you have lots of files and you need to do a bulk update? Well you can use the caspol.exe command line utility bundled with the .Net framework.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "c:\myaspnetproject\*" FullTrust -exclusive on
This blog is my place to share my thoughts, helpful solutions and just random nerdy stuff.