简体   繁体   English

加快ASP.NET开发

[英]Speeding up ASP.NET development

We're developing web applications using DotNetNuke as a framework and our custom modules for required functionality.我们正在开发 web 应用程序,使用 DotNetNuke 作为框架和我们为所需功能提供的自定义模块。 The problem is, that it takes a long time for the website to load when you do any changes to code.问题是,当您对代码进行任何更改时,加载网站需要很长时间。 I'm looking at up to 1 minute for each restart, which really is painfully slow.我每次重新启动最多需要 1 分钟,这真的很慢。 This leads to very slow develop-rebuild-test cycle.这导致非常缓慢的开发-重建-测试周期。

We're using both console projects and winforms projects as testing ground for new functionality for faster development, but still there is lots of UI functionality that has to be done with a browser.我们正在使用控制台项目和 winforms 项目作为新功能的测试平台,以加快开发速度,但仍有许多 UI 功能必须通过浏览器完成。

Does anyone have any tips on how to speed up/prevent the appdomain restart that occurs when something changes in the bin folder of a web app?有没有人有关于如何加速/防止在 web 应用程序的 bin 文件夹中发生更改时发生的 appdomain 重启的任何提示?

You're bumping up against a drawback of ASP.NET, when used with large web apps.当与大型 web 应用程序一起使用时,您会遇到 ASP.NET 的缺点。

DotNetNuke has many significant DLLs and VB files that will all have to be reprocessed if all you do is change one single DLL. DotNetNuke 有许多重要的 DLL 和 VB 文件,如果您所做的只是更改一个 DLL,它们都必须重新处理。 If you have 50 Module DLL's in your bin, all 50 Module DLL's will be reprocessed by ASP.Net upon your next application request.如果您的 bin 中有 50 个模块 DLL,则所有 50 个模块 DLL 将在您的下一个应用程序请求时由 ASP.Net 重新处理。

Here is my suggestion:这是我的建议:

Hook up the following folders to your source control (not your entire DNN folder):将以下文件夹连接到源代码管理(不是整个 DNN 文件夹):

  • bin (I suggest ignoring all DNN DLL's, so upgrades go smoother) bin(我建议忽略所有 DNN DLL,因此升级 go 更平滑)
  • Portals_default\Skins Portals_default\Skins
  • Portals_default\Containers Portals_default\Containers
  • js js
  • DesktopModules (ignore Admin or any built in modules) DesktopModules(忽略管理员或任何内置模块)
  • images (ignore the core DNN images if you wish, or any of your own clunky images folders like thousands of customer photos)图像(如果您愿意,可以忽略核心 DNN 图像,或者您自己的任何笨重图像文件夹,例如数千张客户照片)
  • (optional) CompanyName\ (where you might wish to keep other .NET Projects that need relative access to DLL's in the bin folder) (可选)CompanyName\(您可能希望在其中保留其他需要对 bin 文件夹中的 DLL 进行相对访问的 .NET 项目)

When one of your developers requires repetitive compiles / page loads, he will benefit most by eliminating as many DLL's in the bin folder as possible.当您的一位开发人员需要重复编译/页面加载时,他将通过消除 bin 文件夹中尽可能多的 DLL 获得最大收益。 It will also help to use a barebones skin for testing, if you can (They are very easy to make).如果可以的话,它也将有助于使用准系统皮肤进行测试(它们很容易制作)。

The barebones skin (which should utilize 1 or 2 skin objects, at most) and an absolute minimum of DLL's (DNN Core + the bare minimum of your own) will get you the best speed for development.准系统皮肤(最多应使用 1 或 2 个皮肤对象)和绝对最少的 DLL(DNN 核心 + 您自己的最低限度)将为您提供最佳的开发速度。

When your developer is done with the focused development of the one module, he can update those folders which he deleted items from source control (svn here), finish testing his code in the context of the full DLL/Skin set, and he'll be set.当您的开发人员完成一个模块的重点开发后,他可以更新他从源代码管理中删除项目的那些文件夹(此处为 svn),在完整的 DLL/Skin 集的上下文中完成对他的代码的测试,他将被设置。

Sometimes it is worth the trouble.有时这是值得的麻烦。 I can't get you down to a few seconds of ASP.NET reprocessing, but I can get you down to 10-15 seconds.我不能让你缩短 ASP.NET 再处理的几秒钟,但我可以让你缩短到 10-15 秒。 (assuming you're running on an SSD) (假设您在 SSD 上运行)

As far as production restarts, make sure your APP Pool recycles during off-hours.就生产重启而言,请确保您的应用程序池在非工作时间回收。

I've looked into whether multi-core setups can somehow decrease this reprocessing time, but haven't had any luck (I have an open question on serverfault)我研究了多核设置是否可以以某种方式减少重新处理时间,但没有任何运气(我有一个关于服务器故障的悬而未决的问题)

DNN does a compile on demand when you add/change pages, if you pre-compile them your turn around time should be much faster.当您添加/更改页面时,DNN 会按需编译,如果您预编译它们,您的周转时间应该会快得多。

Maybe this would help you?也许这会对你有所帮助?

Speeding up build times in ASP.NET 加快 ASP.NET 中的构建时间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM