2

I have a .NET 4.0 C# app that uses Microsoft SQL Server libraries to load SQL Server 2008 (and 2012) packages and analyzes them. I have a couple lines of code that load a SQL Server Package from a DTSX (XML) file.

private Microsoft.SqlServer.Dts.Runtime.Package package;
package.LoadFromXML(packageXml, events);

Every time the LoadFromXML method executes when running in Debug mode, execution slows while I wait for Visual Studio to display several messages on the status line indicating that it is loading symbols for each of the many SQL Server dlls that I have installed and this occurs every time this LoadFromXml method is executed in a loop.

Use CONTROL+ Mouse Scroll to zoom image:

enter image description here This was never a problem before and now the strange part: The code has not changed in months and I have not upgraded any SQL Server components. The code was run in DEBUG mode as recently as couple of days ago with no issues. Obviously, something changed, but I don't know what. When I check "Installed Updates" in the Control Panel, the most recent patch that appears in the end of August. The code was working fine for some time after that.

The performance impact makes debugging very impractical. What can I do to get my debugging working properly once again?

Thinking that the behavior may be controlled by a Debug option setting, I reset all of my Visual Studio Options to the default settings even though I don't think I changed any settings recently. Unfortunately, the problem remained after reverting to the original system settings.

Also, if I open up the project with VS2010, I do not have the issue.

chue x
  • 18,573
  • 7
  • 56
  • 70
Chad
  • 23,658
  • 51
  • 191
  • 321
  • I assume you've seen and tried this [Q&A](http://stackoverflow.com/questions/12567984/visual-studio-debugging-loading-very-slow) – billinkc Sep 26 '14 at 13:20
  • Correct, it did not help. What confuses me is if I have the option to Debug only my code, why does it need the symbols for the SQL Server dlls that my program references? I could tolerate a 1-time "load symbols" hit per run, but it appears to be reloading symbols every time I hit the LoadFroMXml line. – Chad Sep 26 '14 at 16:59
  • 2
    [docs](http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.idtscomponentpersist.loadfromxml.aspx) say not to use this method, have you tried switching to one of recommended ones (e.g. `LoadPackage`)? – BartoszKP Sep 30 '14 at 15:29
  • One way to work around this issue is to switch from the default behavior of attempting to load symbols for all modules to only loading symbols for specified modules. You can do this in Tools/Options/Debugging/Symbols in the section 'Automatically load symbols for:' – Colin Thomsen Oct 02 '14 at 02:54
  • Something off the beaten path. Could you temporarily disable your Anti-Virus (especially the real time scanning) and try it again? I wonder if somehow AV is intercepting the load and doing something peculiar. – Michael Petch Oct 02 '14 at 14:47

1 Answers1

2

I have had similar problems in the past and one of the following remedies helped:

  1. Make sure you have removed all the breakpoints from your code and there is no breakpoint in debug>windows>Breakpoints You would not beleive but sometimes a single breakpoint is the culprit
  2. In Tools>Options>Debugging>General make sure "Enable Just My Code" is ticked
  3. Turn Off IntelliTrace in Tools>Options>IntelliTracnce UnCheck "Enable IntelliTrace"
  4. Make sure all additional Extensions like .`net Reflector is disabled
  5. In Tools>Options>Debugging>Symbols click on ... and create a new directory for storing cached symbols. Then click on Load All Symbols and wait for download to finish then uncheck "Microsoft Symbol Servers" to stop querying the remote servers.
MHOOS
  • 5,146
  • 11
  • 39
  • 74
  • I previously tried enabling "just my code," Intellisense isn't even available in my cheap version. I previously disabled all extensions that could be disabled and had no luck. When you specifically mentioned "reflector extensions" I reconsidered uninstalling Terlerik's "Just Decompile" standalone app on the remote chance that that could somehow be contrubuting. Uninstalling it didn't help. I had already done 5 previously with no luck. It looked like #1 was the culprit. Thanks. – Chad Oct 02 '14 at 19:25