简体   繁体   English

Visual Studio F5调试比Attach to Process慢

[英]Visual Studio F5 debugging is slower than Attach to Process

If i start my application with F5 (debugging) it takes for a certain operation about 2000ms. 如果我用F5启动我的应用程序(调试),它需要大约2000ms的某个操作。 If i start the application with F5 + CTRL (without debugging) and attach Visual Studio with "Attach to Process" it takes only ~100ms. 如果我用F5 + CTRL(没有调试)启动应用程序并使用“附加到进程”附加Visual Studio,它只需要约100毫秒。

Has someone a idea what component can cause this performance 'problem'? 有人知道哪个组件可能导致这个性能“问题”?

C# application / VS 2012. C#application / VS 2012。

Edit 编辑

Code-Snipped: 代码剪断:

Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
changed.Validate(context);
stopwatch.Stop();
Console.WriteLine(stopwatch.ElapsedMilliseconds);

One major thing that makes lot of difference is during F5 or debugging visual studio loads all the pdb files.pdb files are the program database files and are the reason why you are able to debug.If you compile in build mode you will see the bin folder having .pdb file corresponding to every dll. 在F5或调试visual studio中加载所有pdb files.pdb文件是程序数据库文件,这是你能够调试的原因。如果你在构建模式下编译,你会看到bin具有与每个dll对应的.pdb文件的文件夹。

More on pdb files : http://msdn.microsoft.com/en-us/library/yd4f8bd1(vs.71).aspx 有关pdb文件的更多信息: http//msdn.microsoft.com/en-us/library/yd4f8bd1( vs.71) .aspx

one article on this topic http://blogs.msdn.com/b/zainnab/archive/2010/11/01/start-debugging-vs-start-without-debugging-vstipdebug0037.aspx 关于这个主题的一篇文章http://blogs.msdn.com/b/zainnab/archive/2010/11/01/start-debugging-vs-start-without-debugging-vstipdebug0037.aspx

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

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