在使用Visual studio 2010编译项目的时候经常会出现这个问题,因此需要在“C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE”的devenv.exe.config内去掉
<NetFx40_LegacySecurityPolicy enabled="true"/>,然后再重新打开 VS2010,然后重新编译项目即可
如果出现这个问题:错误23 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误。