我可以precompile我的ASP.NET MVC应用程序? [英] Can I precompile my ASP.NET MVC application?

查看:166
本文介绍了我可以precompile我的ASP.NET MVC应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图precompile我的ASP.NET MVC应用程序并将其部署到IIS6中框(带有通配符映射),但是我得到一个错误与3D渲染局部视图(用户控件)。我的dev的机器其工作罚款之前precompiling。

I tried to precompile my ASP.NET MVC application and deploy it to an IIS6 box (with wildcard mapping), however I am getting an error with rendering partial views (user controls). Its working fine on my dev machine before precompiling.

该错误是:

在'/'应用。
  

  局部视图'ListGrid'不能

  被发现。以下地点

  搜索:

  〜/查看/计划/ ListGrid.aspx

  〜/查看/计划/ ListGrid.ascx

  〜/查看/共享/ ListGrid.aspx

  〜/查看/共享/ ListGrid.ascx

Server Error in '/' Application.

The partial view 'ListGrid' could not
be found. The following locations were
searched:
~/Views/Initiative/ListGrid.aspx
~/Views/Initiative/ListGrid.ascx
~/Views/Shared/ListGrid.aspx
~/Views/Shared/ListGrid.ascx

我查查看\\共享的文件,它不存在,我认为是正常的,因为它的precompiled。但是,只是笑声,我把该文件夹的名称ListGrid.ascx一个空白文件,但后来我得到这个错误:

I checked Views\Shared for the file and it was not there, which I thought was normal because its precompiled. But just for giggles I put a blank file in that folder names ListGrid.ascx, but then I got this error:

在'/'应用。
  

  文件'/Views/Shared/ListGrid.ascx'

  尚未$ P $对编译,并不能

  被请求。

Server Error in '/' Application.

The file '/Views/Shared/ListGrid.ascx'
has not been pre-compiled, and cannot
be requested.

我用Google搜索和搜查,但找不到任何类似的问题,但没有运气。

I googled and searched SO but could not find any similar problems, but had no luck.

推荐答案

虽然可以precompile一个MVC站点ASCX和ASPX查看文件是不是在编译的DLL只的.cs文件。您仍然需要部署在.aspx和的.ascx查看文件。

Although you can precompile an MVC site the ascx and aspx view files are not in the compiled dll only the .cs files are. You will still need to deploy the .aspx and .ascx view files.

希望这有助于

这篇关于我可以precompile我的ASP.NET MVC应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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