How to precompile a Web Application project?

99封情书 提交于 2019-12-04 03:23:13
David Hoerster

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.

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.).

Two good Scott Guthrie blogs about this project type:

I've used this project type for some VS2005 and VS2008 projects and it's invaluable (especially for those legacy web site projects!!).

I didn't know this was also in the MSDN library, but here's a nice article in MSDN for WDP's.

I hope this helps!

EDIT: WDP's exist for VS2005 and VS2010 also.

Unfortunately, the way to do this isn't spectacular. You would have to "deploy" the solution locally, then move it, or just compile it on the server where it will go. Either way uses aspnet_compiler.exe. See http://msdn.microsoft.com/en-us/library/ms227976%28v=VS.90%29.aspx for more details.

When you publish the site, uncheck the option that says "Allow this precompiled site to be updateable".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!