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=2.0.0.0, 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.
E.g.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "c:\myaspnetproject\*" FullTrust -exclusive on
- Solved: Cmder – ‘ls’ is not recognized as an internal or external command, operable program or batch file. - 16th April 2024
- Solved: ‘Unable to find package specflow.plus.license’ error - 14th February 2024
- How to: Use GitHub Actions with OIDC to Authenticate with Azure - 16th November 2023
17th November 2014 at 11:30 am
Reblogged this on Dinesh Ram Kali..