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
Latest posts by Shane Bartholomeusz (see all)
- Solved: Filename too long for Git - 18th April 2025
- GitHub Actions Exam Study Guide - 14th February 2025
- Solved: Build Errors Not Showing in VS 2022 - 21st November 2024
Reblogged this on Dinesh Ram Kali..