1
votes

Does anybody know why the Catel Framework examples run so slowly when launched from Visual Stuio? When running any of the demo apps, load time is extremely slow (around 45 seconds). However, running the .exe directly, outside of VS is as fast as one would expect (< 2 sec). System: Windows 7 Pro x64, Visual Studio 2012 Pro

Edit

I narrowed down the problem by reducing the App.xaml.cs code to this:

protected override void OnStartup(StartupEventArgs e)
{
    var serviceLocator = IoC.ServiceLocator.Default;
}

..and set a breakpoint at the opening brace of the method, after F5 it takes 40 seconds to hit that breakpoint. If I comment-out that servicelocator line and then run, the breakpoint is hit almost instantly.

Edit 2

..ok, to narrow it down further: any reference to Catel.Core will cause the huge delay. When I have the Catel reference line uncommented, the following extra lines are seen in the Output window:

'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\bruce.tw\documents\visual studio 2012\Projects\CatelLoggingTinker\CatelLoggingTinker\bin\Debug\Catel.Core.dll', Symbols loaded.
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread '<No Name>' (0x3d24) has exited with code 0 (0x0).
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.SqlXml\v4.0_4.0.0.0__b77a5c561934e089\System.Data.SqlXml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'CatelLoggingTinker.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'

If my only line in OnStartup is

Catel.Collections.ListDictionary<int, int> cc = new Catel.Collections.ListDictionary<int, int>();

... then the output window first shows that Catel.Core.dll is loaded right away, but then UIAutomationProvider.dll takes ages to appear.

Is there something wrong with my GAC?

2

2 Answers

1
votes

A few hints:

  1. Performance considerations
  2. Check if the debug logger is taking too much time (the output window is trying to keep up, slowing things down)
  3. Check if you have symbols enabled, then it might be visual studio trying to load source symbols (see docs)
1
votes

I also struggled with this Problem (in fact on many Computers i tried it out!).

My solution was the following:

in VS "Debug-> Options and Settings":

  • Debugging -> Symbols:
  • choose Option "All modules, unless excluded".
  • Add the following to the exclude list:

  • Catel.Core.dll

  • Catel.Extensions.Controls.dll
  • Catel.MVVM.dll

(and whichever Catel module you happen to reference).

The strangest thing: after i did this once, i can remove those dll from the exclude list, and still start Debugging fast :-/

(although this might Change after next reboot....idk)

But i Keep them in exclude list anyways, cause i don't Need to load those Modules at all - they should be "bugfree" afterall, at least shouldnt be in need to debug by me....

Regards

Johannes Colmsee

Update: it turns out you can easily disable loading of all Catel dll's by only specifying "Catel.*.dll" in the excluded module list

Another nice side-effect by this is, that you wont be bothered by those "Manifest Resouce stream not found exceptions" or the "ThreadAbortException" (when PleaseWaitService finishes) (all for Debug Settings "Break on Thrown Exceptions")