将 ASP.NET MVC4 应用程序部署到 GoDaddy 编译器问题 [英] Deploying ASP.NET MVC4 App to GoDaddy Compiler issue

查看:22
本文介绍了将 ASP.NET MVC4 应用程序部署到 GoDaddy 编译器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看过几篇关于将 MVC 应用程序部署到 GoDaddy 的帖子.他们似乎都没有解决我们遇到的问题.我们遵循了有关检查运行时版本、IIS 管道模式、在程序集上发布和复制本地为 true 的建议,因此所有这些都可以在 GoDaddy.Com 上运行.

我们遇到的问题是,当我们尝试访问该站点时,我们会收到组策略异常,因为 ASP.NET 运行时正在尝试调用 C# 编译器.

<块引用>

[Win32Exception (0x80004005): 该程序被组策略阻止.如需更多信息,请联系您的系统管理员]

<块引用>

[ExternalException (0x80004005): 无法执行程序.正在执行的命令是C:WindowsMicrosoft.NETFrameworkv4.0.30319csc.exe"........

我们已经完成了发布设置并选择了预编译站点.那并没有解决问题.查看了该站点,并且没有部署 CS 文件.Global.asax 文件确实引用了一个代码隐藏文件.由于我们预编译了站点,因此我们尝试删除 global.asax 文件,但这也不能解决问题.

任何想法都会很棒.

解决方案

几个月来我一直在为同样的问题而苦苦挣扎.并最终解决了它.在godaddy 的plesk 中,我更改了ASP.Net 设置.首先将 CAS-trustlevel 更改为 Full.然后我在我的项目的 Web.config 中更改了以下内容:

  • 向 system.web 添加完全信任级别
  • 删除 system.codecom 中的编译器

 编译调试="true" targetFramework="4.5.2"/><httpRuntime targetFramework="4.5.2"/><trust level="Full"/><!-- 只需将其添加到 webconfig --></system.web><system.codedom><!-- 2 个标签之间的所有内容都被删除--></system.codedom>

这就解决了我的问题.

Have seen several posts about deploying MVC apps to GoDaddy. None of them seem to address the issue we are having. We have followed the advice about checking runtime versions, IIS pipeline modes, publishing and copy local to true on assemblies so all works on GoDaddy.Com.

The issue we are having is that when we try to visit the site we get a Group Policy exception because ASP.NET runtime is trying to invoke the C# compiler.

[Win32Exception (0x80004005): This program is blocked by group policy. For more information, contact your system administrator]

[ExternalException (0x80004005): Cannot execute a program. The command being executed was "C:WindowsMicrosoft.NETFrameworkv4.0.30319csc.exe".........

We have gone through the publish settings and elected to precompile the site. That didn't fix the issue. Have looked at the site and there are no CS files deployed. The Global.asax file does reference a codebehind file. Since we precompiled the site we tried deleting the global.asax file and that doesn't fix the issue either.

Any thoughts would be great.

解决方案

I have struggled with the same problem for months. And finally solved it. In the plesk on godaddy I changed the ASP.Net settings. First changed CAS-trustlevel to Full. Then I changed in the Web.config of my project the following:

  • Add trust level full to the system.web
  • Remove the compilers in the system.codecom

 <system.web>
    compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
    <trust level="Full"/>             <!-- Just add this to the webconfig -->
 </system.web>

 <system.codedom>
              <!-- All is removed between the 2 tags-->
 </system.codedom>

and that solved my problem.

这篇关于将 ASP.NET MVC4 应用程序部署到 GoDaddy 编译器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆