asp.net - 配置错误 : <compilation debug ="true" targetFramework ="4.0"> ASP. NET MVC3

标签 asp.net asp.net-mvc asp.net-mvc-3 razor

我尝试在 somee.com 上部署我的网站,但不断收到此错误

enter image description here

我尝试过谷歌搜索,它说我必须将我的应用程序池更改为 ASP.NET 4.0。我已经尝试过了,但没有成功:(

信息:

-我的网站是用 4.0 框架编码的
-我正在使用 .NET Framework v4.0 集成
-我已经在 Windows 功能中检查了所需的内容
-我正在使用 ASP.NET MVC3
-我已经输入 cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 然后 aspnet_regiis -ir 到 cmd
-64 位操作系统

这是我发布网站的步骤

  1. 首先,我手动将这些内容添加到我的引用中,然后将“复制本地”更改为“True”

    微软.Web.基础设施
    System.Web.Helpers
    系统.Web.Mvc
    System.Web.Razor
    System.Web.WebPages
    System.Web.WebPages.Deployment
    System.Web.WebPages.Razor

  2. 我在我的 Web Config 上编辑了此内容

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0"/>
    <authentication mode="None"/>
    </system.web>
    </configuration>

  3. 我添加了创建 _bin_deployableAssemblies 的可部署依赖项,其中包含此内容

    Microsoft.Web.Infrastruct.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.Razor.dll

  4. 然后单击“发布”并进行此设置

    这就是我发布的方式,可以吗?还是我必须在这里进行一些更改? enter image description here

  5. 我转到了 IIS 管理器。我右键单击“站点”下的“默认网站”,然后选择使用此设置添加应用程序 enter image description here

  6. 结果就是这样
    enter image description here enter image description here

  7. 我去了 C:/inetpub/wwwroot 并看到了这个文件
    enter image description here

  8. 然后我将其压缩为 zip,然后将其上传到我的 somee.com 帐户中,然后检查了我的网站,现在我收到了上面的配置错误。

    以上是我更新的问题,我重新发布了我的网站,并包含了我如何发布它的步骤。我将其包含在内,以便大家可以提出建议,如果我在发布网站的方式上做错了什么,并且可能是上述错误的原因。提前致谢:)


    我的网站在我的机器本地主机的iis中运行良好,只有在部署到互联网上时才会出现该错误。 顺便说一句,我正在关注这些网站的教程 How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment" Programming ASP.NET MVC 4 Chapter 19. Deployment Deployment ASP.NET MVC 3 project to IIS and somee

    问题:这个问题可能是什么原因:(这是我第一次在互联网上部署网站。希望你们能帮助我。如果您需要更多信息,请告诉我。

我的 IIS 管理器 enter image description here

我的配置 enter image description here

或者这可能是我的问题的原因?

enter image description here

<小时/>

好的,这个问题已经解决了。我发现我的设置没有问题。问题出在虚拟主机网站的设置上。我将 ASP.NET 版本从 2.0 更改为 4.0,但忘记单击更新按钮:( 我感觉很糟糕,我还没有意识到这一点。我现在面临另一个错误,但这与这个问题无关。谢谢大家试图帮助我:)

最佳答案

This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0. The targetFramework attribute is entirely unrecognized by ASP.NET 2.0 - so changing it to 2.0 won't have the desired effect.

Contact Support / Your Administrator and have the AppPool switched to 4.0.

You could also remove the attribute entirely, however if your site was coded with the 4.0 Framework, then I'm sure something else will cause an error as well.

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

关于asp.net - 配置错误 : <compilation debug ="true" targetFramework ="4.0"> ASP. NET MVC3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15241627/

相关文章:

c# - ASP.NET MVC 3 - 在 Post Redirect Get 工作流中检测当前页面是否被重定向到

javascript - 选中时创建一个复选框,它应该在模态中显示某些输入字段并隐藏其他输入字段

c# - System.Data.SqlClient.SqlException : 'Incorrect syntax near ' `'.'

asp.net-mvc-3 - 如何获取用户域组?

asp.net - 如何让用户选择数据库表中的列

asp.net-mvc - 自定义格式化日期的 MVC3 不显眼的日期验证

c# - 如何在post方法中获取实际 Controller

c# - 为什么新的 AppDomain 会加载不必要的 DLL?

javascript - 我自己的 javascript 文件需要智能感知或自动完成功能

asp.net - 将 gridview 寻呼机渲染到表格的 tfoot 部分