我已将我的网站配置为IIS,但我收到配置错误。 我也上传了同一个项目,但那时没有发生任何错误。
这是我的web.config文件中的一小部分内容:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
我遇到错误:
配置错误
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. Source Error: Line 38: <trustLevel name="Full" policyFile="internal" /> Line 39: </securityPolicy> Line 40: <compilation debug="true" targetFramework="4.0"> Line 41: <assemblies> Line 42: <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
答案 0 :(得分:2)
答案 1 :(得分:1)
转到IIS并通过高级设置检查您正在使用的应用程序池。
然后确保您使用的应用程序池的.Net Framework必须设置为4.0。