问题描述
我最近你可以precompile Web应用程序项目听见。我的问题是怎么样?
I've heard recently that you can precompile Web Application projects. My question is how?
现在,当我做了发布
我的Web应用程序,然后选择只需要文件来运行这个应用程序
我得到它的出版,但它仍然有我所有的ASPX页面,它仍然只会JIT编译的页面。我如何让这个所有的ASPX页面都是把他们的服务器之前pcompiled $ P $?
Right now, when I do a publish
for my web application and select only files needed to run this application
I get it published but it still has all my ASPX pages and it will still only JIT compile the pages. How do I make it so that all of the ASPX pages are precompiled before putting them on the server?
推荐答案
您可以下载一个叫Web部署项目(WDP)项目模板(VS2008版<一个href=\"http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en\"相对=nofollow>这里),增强的Visual Studio构建和部署功能。这基本上包装aspnet_compile.exe的功能,但可以让你直观地做到这一点作为整个解决方案的一部分。
You can download a project template called a Web Deployment Project (WDP) (VS2008 version here), which enhances the build and deployment features of Visual Studio. This basically wraps features of aspnet_compile.exe, but allows you to do this visually as part of your overall solution.
除了pre-汇编,它也可以让你做一些有趣的事情,比如配置文件替换(非常适合部署到不同的环境)和设置您的组件如何构建(每页,每个站点,等等)。
Besides pre-compilation, it also allows you do a number of interesting things, like config file replacement (great for deploying to different environments) and setting how your assemblies are built (per-page, per-site, etc.).
有关该项目类型有两个很好的斯科特Guthrie的博客:
Two good Scott Guthrie blogs about this project type:
- 为VS2008工具公告:
http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx - 刀具的基本穿行
(VS2005的版本,但它基本上
在VS2008一样):
- announcement of the tool for VS2008:http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx
- basic walk-through of the tool(VS2005 version, but it's basicallythe same in VS2008):http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx
我用这个项目类型有些VS2005和VS2008的项目,它是无价的(特别是对于那些传统的网站项目!)。
I've used this project type for some VS2005 and VS2008 projects and it's invaluable (especially for those legacy web site projects!!).
我不知道这也是在MSDN库,但一个很好的文章中MSDN上WDP的。
I didn't know this was also in the MSDN library, but here's a nice article in MSDN for WDP's.
我希望这有助于!
编辑:
WDP的存在并的也。
这篇关于如何precompile一个Web应用程序项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!