Asp.net website deployment options

本文介绍了如何通过预编译来提高ASP.NET网站的部署速度和运行效率。具体步骤包括设置目标位置、禁用更新选项、使用固定命名等。文中还提到了Web应用程序项目的预编译比较。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

http://dotnetperls.com/precompiled-aspnet

 

Target Location:
[Text input box]
This is where the published site will be put.
(The author suggests using a location on your disk C:/ for now.)

"Allow this precompiled site to be updatable"
[X]
This indicates whether you want to use dynamic compilation or not. Your
website is only updatable if you do not compile it all into a big assembly before
you deploy it.

"Use fixed naming and single-page assemblies"
[X]
Fixed naming is naming that is always the same.
The author recommends this as it will allow to easily replace old assemblies on
the server
.

"Enable strong naming on precompiled assemblies"
[X]
This is a security option.

 

Points on options. There are a couple points about these options the author wants to stress. The first checkbox above, "Allow this... to be updatable" is actually Microsoft's way of saying "Use dynamic compilation". With this option, all of your pages will be compiled at the last moment. This can be very slow.

note: from envykok

"Allow this... to be updatable"-only when u used this page, it will be compiled

 

How can I use the fastest compilation mode?

If by fastest you mean for the site once deployed, then we must use "site precompilation." Let's assume your site is high-volume, popular, and important to you. It is important that the site respond instantly when a potential customer comes along. Definitely use site compilation. Here are the steps to enable site compilation.

Check target location. The target publish location is probably already set, but if it isn't, set the target location to your C:/ drive.

Uncheck "updatable" box. Allowing your site to be updatable will make it slower. Therefore, for site precompilation uncheck this box.

Check "use fixed naming". Fixed naming makes it easier to drag and drop your new DLL to the old DLL location and replace the files. That's all this option is good for, but this is really handy and it is best to use fixed naming.

Verify that it worked. Open your Projects folder in the Documents > Visual Studio 2008 folder. Your precompiled site will be in the folder corresponding to your site's name. It should be in the PrecompiledWeb folder.

Note on Web Application projects. The Web Application project type is another model for creating ASP.NET sites. It does not have the same precompiled options, but you can use Publish for the same effect.

See Web Application Project Comparison.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值