Debugging Catel using Symbols.org

May 25, 2012 at 10:44 AM
Edited May 25, 2012 at 10:44 AM

In the documentation of Catel I saw the nice feature to be able to debug the Catel code using Symbols.org.

I have made the necessary steps to do this.

When I start my debugging session I can see that symbols are loaded:

 'nl.VES.TimeLog.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Development\Prutsen\nl.VES.TimeLog\nl.VES.TimeLog.Shell\bin\Debug\Catel.Core.dll', Symbols loaded.

However, when I try to step into the code (the ServiceLocator in my case just as a test) I get the error that

The file 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs' does not exist.

What seems odd is that the Core.NET35 seems to be searched for whereas my code is compiled againtst NET40. When I look into my project, the correct version (4.0) of the Catel dll is referenced. 

What am I doing wrong here?

 

Coordinator
May 25, 2012 at 10:47 AM

This is because all files are located in the NET35 projects. All other projects simply link their files to the original ones (this allows us to provide Catel for NET35, NET40, NET45, SL4, SL5 and WP7, otherwhise it would simple be too much work to maintain it).

However, it is strange that the pdb files cannot find the source because they are packaged as well. Actually, NuGet and SymbolSource should replace the C:\Source\Catel by the actual file in the pdb, so something must have gone wrong there.

Can you try the latest version using this nuget command, it is released with a newer version of Nuget:

install-package Catel.Extensions.Windows -includeprerelease

May 25, 2012 at 11:56 AM

It's my first attempt at all to use Symbols.org so perhaps I have done something wrong :)

When I try to execute

install-package Catel.Extensions.Windows -includeprerelease

in the Package Manager Console I get the error

Install-Package : Unable to find package 'Catel.Extensions.Windows'.

At line:1 char:16

+ install-package <<<< Catel.Extensions.Windows -includeprerelease

+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException

+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

Coordinator
May 25, 2012 at 11:57 AM

No, my mistake. It should be Catel.Extensions.Controls (we changed this recently (3.0), so I am still in the old ways of thinking :)).

May 25, 2012 at 12:04 PM

Same Error

Locating source for 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs'. (No checksum.)
The file 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs' does not exist.
Looking in script documents for 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs'...
Looking in the projects for 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
Looking for source using source server...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs.
The debugger could not locate the source file 'c:\Source\Catel\src\Catel.Core.NET35\IoC\ServiceLocator.cs'.

Perhaps I have not configure debugging the symbols correctly? Can I check if it load something from Symbols.Org?

When I look in my local Symbols folder 'CatelCore.pdb' is present, so VS2010 has downloaded something from Symbols.Org I guess :)

 

Coordinator
May 25, 2012 at 12:06 PM

You followed all these steps:

http://www.symbolsource.org/Public/Home/VisualStudio

Make sure not to forget any step.

May 25, 2012 at 12:31 PM

I have double checked but executed all 8 steps mentioned there.

Coordinator
May 25, 2012 at 12:47 PM

I will try this tonight and let you know if I can make it to work.

May 25, 2012 at 12:47 PM
Edited May 25, 2012 at 12:49 PM

It works :)

Don't quite know why now. I registered on the Symbols.org site and used the authentication url from the registration so perhaps that did the trick,

No I get an exception The Type 'Catel.MVVM.IViewModelFactory' is not registered, not even in an external container' (probably caused by the new version of Catel?) but I can see the break in the method ResolveType of the ServiceLocator so I'm in the code :)

I can look at all methods in the Call Stack now. Neet! :)

Coordinator
May 25, 2012 at 12:50 PM

:) :)

Yes, it is a bug we fixed, but we haven't released a new version version to nuget yet (will do tomorrow with several new fixes). You can, for now, go back to 3.1 if you don't mind.

May 25, 2012 at 1:27 PM

3.1 now also works with debugging. So perhaps registering with Symbols.org is not as optional as they state :)

Coordinator
May 25, 2012 at 1:37 PM

Great to hear, thanks for the feedback! Don't forget to check out the new version tomorrow anyway ;)

You can follow all the news using twitter: @CatelMvvm

May 25, 2012 at 1:42 PM

Now following @CatelMvvm ;)

May 16, 2013 at 8:21 PM
Edited May 16, 2013 at 8:22 PM
Are the symbols no longer present on symbolsource.org?

Debugging doesn't work and when I look at symbolsource.org I can only see symbols for catel version 3.2 and older?

Is there a new way to use catel's pdb files and if so please enlighten me :)
Coordinator
May 18, 2013 at 5:04 AM
It's broken at the moment. Somehow somewhere either nuget OR symbolssource broke something approx. 4 months ago. I tried to fix it once, but it was too much work and it's not high on the priority list. I am currently on holiday, but once I get back I might have another look at it. Please create an issue at http://catelproject.atlassian.net so I remember when I get back ;-)
May 18, 2013 at 1:43 PM
I was wondering why there was still no release of 4.6 but that's clear now ;)

Issue has been created.

Been away from catel for some time and good to see that I no longer have to invent EF 5 support myself :D Hope my 'old' 3.2 application doesn't 'break' in too many ways.

Have a nice holiday ;)