有没有办法加快asp.net中的编辑 - 编译 - 调试周期?

时间:2021-10-18 02:43:22

I have been programming in php for a while, and recently I started a new job ago where I am now programming in c#/asp.net.

我已经在php编程了一段时间,最近我开始了一个新工作,我现在在c#/ asp.net编程。

While asp has decent performance when deployed, there is one thing that has been bugging me for the past few months. After any code change it takes about 30 seconds for the page to reload for testing.

虽然asp在部署时表现不错,但有一件事在过去的几个月里一直困扰着我。任何代码更改后,页面重新加载进行测试大约需要30秒。

I guess it is doing the JIT compiling or something. But it can be REALLY frustrating, especially if I am concentrating, and want to test out several incremental changes as quickly as possible, only to have to stare at a blank page for 30 seconds.

我猜它正在进行JIT编译或其他什么。但它真的很令人沮丧,特别是如果我集中注意力,并希望尽快测试几个增量变化,只需要盯着空白页30秒。

Does anyone have any tips to speed this process up?

有没有人有任何提示来加快这个过程?

6 个解决方案

#1


2  

In Visual studio 2005 every reference you add adds a .refresh file that makes sure the reference did not change since last time and if so brings the new version - if your references stay the same, you can just remove it!
also see here for more tips for VS 2005

在Visual Studio 2005中,您添加的每个引用都会添加一个.refresh文件,以确保引用自上次以来没有更改,如果是这样,则会引入新版本 - 如果您的引用保持不变,则可以删除它!另请参阅此处了解VS 2005的更多提示

#2


1  

I guess that can be frustrating coming from PHP. Thirty seconds sounds far too long though. Ensure the basics like free ram etc..

我想这可能会让PHP感到沮丧。三十秒听起来太长了。确保免费ram等基础知识。

A couple of tips. 1. You do not have to run the debugger in order to run the site. Once you have the site up with the built in VS web server or IIS, you can make your code changes, build and just refresh the page in your browser. No need to hit play and have VS start the whole debug process. If you actually want to debug though, you don't have a choice. 2. Changes to an aspx page do not require a rebuild. I make changes and simply refresh the page to see the result instantly.

几个提示。 1.您无需运行调试程序即可运行该站点。使用内置的VS Web服务器或IIS建立站点后,您可以更改代码,构建并在浏览器中刷新页面。无需点击播放并让VS启动整个调试过程。如果你真的想调试,你没有选择。 2.对aspx页面的更改不需要重建。我进行了更改,只需刷新页面即可立即查看结果。

Check out the web tab in the project settings to configure how you want VS to handle serving the site. There are some options in there to hopefully help you suite it to your style. ex. I don't let VS launch a browser for me whenever I want to debug. I set the option for it to just wait for a request. Then I can just use the browser of my choice to get started.

查看项目设置中的Web选项卡,以配置您希望VS如何处理为站点提供服务。有一些选项可以帮助您适应您的风格。恩。每当我想调试时,我都不会让VS为我启动浏览器。我为它设置了等待请求的选项。然后我可以使用我选择的浏览器开始。

Good luck

祝你好运

#3


1  

I feel your pain.

我感觉到你的痛苦。

Personnaly I like the ASP.NET website project better for speed of developing. I don't know if you have that possibility though..

Personnaly我更喜欢ASP.NET网站项目,以提高开发速度。我不知道你是否有这种可能性..

In visual studio do file->new website.

在visual studio中执行文件 - >新网站。

For this project type you don't need a rebuild all the time and you can just refresh a page in your browser when you have changed it. (no rebuild/debug necessary)

对于此项目类型,您不需要一直重建,只需在浏览器中更改页面即可。 (不需要重建/调试)

#4


1  

Two things I have found:

我发现了两件事:

  • Try alternating between the "User Visual Studio Development Server" and "Local IIS Server" in your project properties / Web tab. Depending on your project, one may be faster to start and attach to than the other.
  • 尝试在项目属性/ Web选项卡中的“用户Visual Studio开发服务器”和“本地IIS服务器”之间交替。根据您的项目,启动和连接可能比另一个更快。
  • If you have projects in your solution, such as CLR-based SQL procedures, they take a few seconds to deploy to the SQL server. If you can afford to remember to turn them back on, or make a separate project config, disable them in the build so they do not get deployed every time you press F5.
  • 如果解决方案中有项目(例如基于CLR的SQL过程),则需要几秒钟时间才能部署到SQL Server。如果您能够记得重新打开它们,或者单独创建项目配置,请在构建中禁用它们,这样每次按F5时都不会部署它们。

Doing those cut my "F5 to live" time from about 20 seconds to 4.

做那些将我的“F5生活”时间从大约20秒减少到4秒。

#5


0  

I've had similar experiences, it can be slow to recompile at times, but varies based on where and what code is being changed - ie if it is app_code or just page specific.

我有类似的经历,有时可能会很慢重新编译,但根据更改的位置和代码而有所不同 - 即,如果它是app_code或只是页面特定的。

What sort of hardware are you running on? VS can be a memory hog, and anything less than 2GB seems to make it slow.

你在运行什么样的硬件? VS可以是内存耗尽,任何小于2GB的东西似乎都会让它变慢。

#6


-1  

Our website has a very long load time due to actions which only occur during the Application Start phase (when the ASP worker process starts). In particular loading commonly used objects from a database into memory was causing a significant delay. We found that using compilation symbols to disable some features when debugging eg security and user roles, helped a lot.

我们的网站由于仅在应用程序启动阶段(ASP工作进程启动时)发生的操作而具有非常长的加载时间。特别是将数据库中常用的对象加载到内存中会导致显着的延迟。我们发现在调试安全性和用户角色时使用编译符号来禁用某些功能,这些都有很大帮助。

#1


2  

In Visual studio 2005 every reference you add adds a .refresh file that makes sure the reference did not change since last time and if so brings the new version - if your references stay the same, you can just remove it!
also see here for more tips for VS 2005

在Visual Studio 2005中,您添加的每个引用都会添加一个.refresh文件,以确保引用自上次以来没有更改,如果是这样,则会引入新版本 - 如果您的引用保持不变,则可以删除它!另请参阅此处了解VS 2005的更多提示

#2


1  

I guess that can be frustrating coming from PHP. Thirty seconds sounds far too long though. Ensure the basics like free ram etc..

我想这可能会让PHP感到沮丧。三十秒听起来太长了。确保免费ram等基础知识。

A couple of tips. 1. You do not have to run the debugger in order to run the site. Once you have the site up with the built in VS web server or IIS, you can make your code changes, build and just refresh the page in your browser. No need to hit play and have VS start the whole debug process. If you actually want to debug though, you don't have a choice. 2. Changes to an aspx page do not require a rebuild. I make changes and simply refresh the page to see the result instantly.

几个提示。 1.您无需运行调试程序即可运行该站点。使用内置的VS Web服务器或IIS建立站点后,您可以更改代码,构建并在浏览器中刷新页面。无需点击播放并让VS启动整个调试过程。如果你真的想调试,你没有选择。 2.对aspx页面的更改不需要重建。我进行了更改,只需刷新页面即可立即查看结果。

Check out the web tab in the project settings to configure how you want VS to handle serving the site. There are some options in there to hopefully help you suite it to your style. ex. I don't let VS launch a browser for me whenever I want to debug. I set the option for it to just wait for a request. Then I can just use the browser of my choice to get started.

查看项目设置中的Web选项卡,以配置您希望VS如何处理为站点提供服务。有一些选项可以帮助您适应您的风格。恩。每当我想调试时,我都不会让VS为我启动浏览器。我为它设置了等待请求的选项。然后我可以使用我选择的浏览器开始。

Good luck

祝你好运

#3


1  

I feel your pain.

我感觉到你的痛苦。

Personnaly I like the ASP.NET website project better for speed of developing. I don't know if you have that possibility though..

Personnaly我更喜欢ASP.NET网站项目,以提高开发速度。我不知道你是否有这种可能性..

In visual studio do file->new website.

在visual studio中执行文件 - >新网站。

For this project type you don't need a rebuild all the time and you can just refresh a page in your browser when you have changed it. (no rebuild/debug necessary)

对于此项目类型,您不需要一直重建,只需在浏览器中更改页面即可。 (不需要重建/调试)

#4


1  

Two things I have found:

我发现了两件事:

  • Try alternating between the "User Visual Studio Development Server" and "Local IIS Server" in your project properties / Web tab. Depending on your project, one may be faster to start and attach to than the other.
  • 尝试在项目属性/ Web选项卡中的“用户Visual Studio开发服务器”和“本地IIS服务器”之间交替。根据您的项目,启动和连接可能比另一个更快。
  • If you have projects in your solution, such as CLR-based SQL procedures, they take a few seconds to deploy to the SQL server. If you can afford to remember to turn them back on, or make a separate project config, disable them in the build so they do not get deployed every time you press F5.
  • 如果解决方案中有项目(例如基于CLR的SQL过程),则需要几秒钟时间才能部署到SQL Server。如果您能够记得重新打开它们,或者单独创建项目配置,请在构建中禁用它们,这样每次按F5时都不会部署它们。

Doing those cut my "F5 to live" time from about 20 seconds to 4.

做那些将我的“F5生活”时间从大约20秒减少到4秒。

#5


0  

I've had similar experiences, it can be slow to recompile at times, but varies based on where and what code is being changed - ie if it is app_code or just page specific.

我有类似的经历,有时可能会很慢重新编译,但根据更改的位置和代码而有所不同 - 即,如果它是app_code或只是页面特定的。

What sort of hardware are you running on? VS can be a memory hog, and anything less than 2GB seems to make it slow.

你在运行什么样的硬件? VS可以是内存耗尽,任何小于2GB的东西似乎都会让它变慢。

#6


-1  

Our website has a very long load time due to actions which only occur during the Application Start phase (when the ASP worker process starts). In particular loading commonly used objects from a database into memory was causing a significant delay. We found that using compilation symbols to disable some features when debugging eg security and user roles, helped a lot.

我们的网站由于仅在应用程序启动阶段(ASP工作进程启动时)发生的操作而具有非常长的加载时间。特别是将数据库中常用的对象加载到内存中会导致显着的延迟。我们发现在调试安全性和用户角色时使用编译符号来禁用某些功能,这些都有很大帮助。