如何使用ASP.NET MVC视图precompilation与APP_ code帮手? [英] How to use ASP.NET MVC view precompilation with App_Code helpers?

查看:264
本文介绍了如何使用ASP.NET MVC视图precompilation与APP_ code帮手?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使视图编辑有我的ASP.NET MVC3的网站加载速度更快。我的网站托管在AppHarbor。

I am trying to enable view compilation to have my ASP.NET MVC3 web site load faster. My web site is hosted on AppHarbor.

不过,我的看法使用MVC3视图助手,在APP_ code文件夹中定义。

However, my views make use of MVC3 view helpers, defined in the App_Code folder.

当我尝试加载我的网站,我得到:
目录/ APP_ code /'是不允许的,因为应用程序是precompiled。

When I try to load my web-site, I get: "The directory '/App_Code/' is not allowed because the application is precompiled."

我怎样才能阻止APP_ code文件夹被部署到Web服务器,但仍然有APP_ code佣工pre-编译?

How can I stop the App_Code folder being deployed to the web-server, but still have the App_Code helpers pre-compiled?

我试着改变佣工内容=无,但是这导致了AppHarbor建立自己的错误,因为帮助文件不能pre-编译过程中被发现。

I've tried changing the helpers to Content=None, but this leads to an AppHarbor build error because the helper files cannot be found during pre-compilation.

推荐答案

老问题,但我刚刚得到这个问题,下面的程序为我工作:

Old question, but I just got that problem, and the following procedure has worked for me:


  1. 转至 https://appharbor.com/your-application

  2. 单击上设置。

  3. 单击上建设| DISABLE preCOMPILATION。

  4. 强制appharbor做一个重建/重新部署(推新提交到库)。

这篇关于如何使用ASP.NET MVC视图precompilation与APP_ code帮手?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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