The CAS policy explicitly used by this method has been deprecated by. NET Framework.
When an application developed with vs2008 is opened in vs2012, the following message is displayed:
The CAS policy explicitly used by this method has been deprecated by. NET Framework. To enable the CAS policy for compatibility reasons, use the NetFx40_LegacySecurityPolicy configuration switch.
I searched for related information on the Internet and checked the Microsoft Help file. There are roughly two methods mentioned:
1. Add C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ devenv.exe. config in the default vs installation directory.
<Configuration>
<Runtime>
<NetFx40_LegacySecurityPolicy enabled = "true"/>
</Runtime>
</Configuration>
This method has been tried locally.
2. Add the following content to the application configuration file web. config:
<System. web>
<Trust level = "Full" legacyCasModel = "true"/>
</System. web>
After the application is added, the application runs normally.