c# - Asp.net MCV4 框架问题

标签 c# asp.net asp.net-mvc-4

我使用 VS 2012 和 MVC4 制作了一个网站,它在我的本地主机上工作,但是当我发布并放置我的主机时它不起作用。 IIS 配置相同。但它给了我这个错误行:

这是错误;

Configuration Error 
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: The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, '<compilation targetFramework="4.0">'). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.

Source Error: 


Line 20:   </appSettings>
Line 21:   <system.web>
Line 22:     <compilation targetFramework="4.5" />
Line 23:     <httpRuntime targetFramework="4.5" />
Line 24:     <authentication mode="Forms">

提前感谢您的建议

最佳答案

将此标记更改为 4.0:

<compilation targetFramework="4.0" />

并删除这个标签:

<httpRuntime targetFramework="4.5" />

关于c# - Asp.net MCV4 框架问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12143777/

相关文章:

asp.net-mvc-4 - Azure 上的 PushSharp ASP.net MVC4 问题。 - 无法连接APNS反馈服务

c# - 如何使用 Moq 模拟 SoapException 以单元测试错误处理

c# - 如何使用 EF Core 将 JSON 存储在实体字段中?

c# - asp.net中如何更改日期格式

asp.net - 添加/更新 Web 引用时防止在 Reference.cs 中生成代理类

iis - windows azure 或 IIS 初始加载缓慢

c# - Asp.Net中如何使用按钮调用方法

c# - Entity Framework 对象列表包含对象 lambda 列表

asp.net - 在 aspx 代码中从 C# 变量设置验证器控件的文本?

c# - ASP MVC 如何将参数从 View 传递到 Controller C# 中的方法