如何预编译asp.net网站 [英] How to part pre-compile a asp.net website

查看:97
本文介绍了如何预编译asp.net网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面数量庞大的网站,我在生产服务器上保留预编译版本(带有固定命名)。



每次我做任何更改在我的代码上我必须发布整个网站只是为了一个小小的改变。



我可以花大约一个小时来发布网站,然后才能将我的更改部署到生产服务器。



有没有办法只发布一批页面,以便发布过程更快?



是否有其他选项可以节省发布时间?



注意:发布我的意思是预编译


欢迎任何建议。

I have a website with huge number of pages, i keep pre-compiled version (with fixed naming) on production server.

Every time i make any change on my code i have to Publish the whole website just for a small change.

It takes about an hour to get the website published before i can deploy my changes to production server.

Is there a way to publish only a batch of pages so that the Publish process is faster?

Is there any other option to save the publishing time?

NOTE: By publishing I mean pre-compiling

Any suggestions are welcome.

推荐答案

HI,



有没有办法。

发布过程以两种方式创建dll。

1.将立即创建整个Web程序集,您需要一次性部署整个dll。单页也会改变。



2. Separ当您选择单独的dll选项时,也会创建ate dll。这将有助于您节省发布和部署的时间。在这种情况下,您需要部署单个dll,而不需要部署dll批处理。



谢谢


Yes there is a way.
The publication process creates the dlls in 2 ways.
1. Whole web assembly will be created at once and you need to eploy the whole dlls at a time for a single page changes too.

2. Separate dlls are also created when you will select the option for the indivisual dlls. This will help you in saving the time for publication as well as deployment too. In this case you need to deploy the single dlls not the batch of dlls are required to deploy.

Thanks


Microsoft没有如果你注意到你的页面有三个组件,* .designer,* .aspx * .cs,那么我们真的想要预编译。 * .cs都需要编译成* .dll才能部署到您的网站。传统上有两种类型的可执行文件,exe'和dll'。 Asp.Net网站被编译成一个dll,用于服务器上运行的所有代码隐藏。微软没有办法半编译一个DLL,然后将它与另一半合并你没有改变。



如果您的网站花了这么长时间,那就进行编译和部署。我建议你有更多的架构问题,然后是代码问题。在我工作的地方,我们的主要网站是3,000,000多行代码,以完成用户需要做的所有事情。我们不需要花一个小时来部署。然而,我们所做的是将我们的业务逻辑分解为多个dll'超过100 dll'并且我们的网站项目本身就是aspx和后面的简单代码来驱动流程到我们的业务逻辑。这允许我们通过我们的更改来改变x数字dll以支持新功能,我们不必每次只调整那些已经改变的所有100 dll',这就是性质DLL'的。如果我们的业务逻辑100%包含在我们的网站项目中,那么我们的编译,部署将会显着延长。



您想考虑将代码重构为dll'。如果您没有与ASPX / ASP.NET解决方案结合,另一个选择是考虑ASP / MVC.NET解决方案。我会考虑重构你的网站。如果需要很长时间就会出现一些严重的问题,即使您可以将数据访问权限分解为单独的dll,那么每次更改时,您都不必经常编译和部署处理数据访问的DLL。网站,只有当您更改了数据访问层时。



如果我有更多的帮助请随时联系,chris @howellsonline.ca



干杯
Microsoft doesn''t really have an idea of "pre-compiling" if you notice your pages have 3 components to them, the *.designer, *.aspx *.cs. The *.cs all needs to be compiled into a *.dll to be deployed to your website. Traditionally there are two types of executables, exe''s and dll''s. Asp.Net websites are compiled into a dll for all the code behinds that run on the server. Microsoft does not have a way to "half" compile a dll and then merge it with the other half you haven''t changed.

If your website is taking that long, to compile & deploy. I would suggest you have more of an architecture problem then a code problem. Where I work our main website is 3,000,000+ lines of code, to accomplish everything the user needs to do and does. We don''t take an hour to deploy. however what we have done is broken our business logic up into a number of dll''s over 100 dll''s and our website project in and of it self is just the aspx and the bare bones code behind to drive the flow through to our business logic. This allows us to alter x number dll''s with our changes to support a new feature, We don''t have to deploy all 100 dll''s every time just the ones that have changed, that''s the nature of dll''s. if our business logic was 100% contained in our website project, then our compile, deployment would be significantly longer.

You want to consider refactoring your code into dll''s. Another option if you''re not married to the ASPX/ASP.NET solution is to consider an ASP/MVC.NET solution. I would consider refactoring your site. If it takes that long there''s some serious issues, even if you could break Data access into a separate dll, then you wouldn''t have to constantly compile & deploy the dll which handles your data access, every time you changed the website, only when you changed the Data access layer as well.

If I can be of anymore help please feel free to reach out, chris@howellsonline.ca

Cheers


这篇关于如何预编译asp.net网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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