开发者

When I run a program in debug mode in vs-2010, sometimes after the build is complete, there is a long delay before the program starts. Why?

Sometimes I get an annoying problem. When I try to start the program in debug mode (F5), The build completes relatively quickly, but then vs-2010 just sits there for like 10-15 seconds in between the completion of the build and wh开发者_运维百科en the program starts. The mouse cursor turns to that vista waiting circle (Running windows 7 though).

It also sometimes takes quite some time to STOP the debug mode and get back to visual studio editing mode, or whatever the normal mode of it is called.

Has anyone else had this problem? What could be the cause of it?

Thanks,

Isaac


There are several factors that could affect it.

One of the delays is casued due to JIT compilation.

In debug mode, none of the optimizations are in place. Due to the full debug info being project, the resulting assembly is also bigger and hence will take time to load in memory.

Then if you're running a web app, spinning up webserver might also take time. If you're a console app, then loading relevant assemblies will take some time.

If you've virus scann scanning all files, that'll slow down the file access time and subsequently startup time.

Edit: As you mentioned in your comments, having powerful hardware will help in speedy execution obviously but do understand that there is this extra processing that needs to happen.

A workaround is to start in non-debug mode (Ctrl+F5) and then attach to process later.


Maybe the problem is Vista?

How much RAM do you have?


2GB of ram might be why. I am using a Windows XP box with 2GBs of RAM and I have a slight delay and I know the windows manager for Win7 uses more RAM than XP does


Also check the number of breakpoints you have set up. I've seen debuggers crap out when there are too many break points.

Just use enough for the current task.


I fixed it. I deleted the bin and obj directories of my project directory.

Some file in there must have been the culprit.

Anyone have a clue what might have went wrong?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜