Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - WPF in Avalon debugger visualizer

 
 
Old 01-10-2006   #1 (permalink)
Chris Masters


 
 

WPF in Avalon debugger visualizer

Hey,

I've created a pretty simple UserControl which draws a tree of objects onto
a canvas, which works fine in a test harness. It also works fine when it's
inside my DialogDebuggerVisualizer derived visualizer if I have small app
which containes the default 'TestShowVisualizer' method generated when you
create a debugger visualizer in VS 2005.

However, when I copy my dlls into the Program Files\Microsoft Visual Studio
8\Common7\Packages\Debugger\Visualizers folder and attempt to use it while
debugging, creating the control fails in the generated code on
'System.Windows.Application.LoadComponent(this, resourceLocater);' with a
failure to load the treecontrol.baml resource.

In the generated file, the the InitializeComponent code looks like:

public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new
System.Uri("Test.Debugging;component\\treecontrol.baml",
System.UriKind.RelativeOrAbsolute);
System.Windows.Application.LoadComponent(this, resourceLocater);
}

I'm a little confused by the ';component' section, because as I say, the
control works fine when used in other ways.

Anyone have any thoughts?

Thanks,

Chris



My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
Ashish Shetty [MSFT]


 
 

Re: WPF in Avalon debugger visualizer

The Component keyword in the Uri qualifies the reference to the BAML as
being embedded within that assembly. See
http://nerddawg.blogspot.com/2005/12...ed-within.html

I don't believe you can address resources embedded in any random DLL though.
In your case, does the application's project include the DLL as a reference?
You can add the reference from within Visual Studio or manually by adding
the item <Reference Include="Test.Debugging" /> to the project file.

--
Ashish Shetty [MSFT]
Program Manager, Windows Presentation Foundation (Avalon)
Blog: http://nerddawg.blogspot.com
---
This posting is provided "AS IS" with no warranties, and confers no rights.


"Chris Masters" <chris@dotnetnews.com> wrote in message
news:usx$oO$CGHA.3992@TK2MSFTNGP12.phx.gbl...
> Hey,
>
> I've created a pretty simple UserControl which draws a tree of objects
> onto a canvas, which works fine in a test harness. It also works fine when
> it's inside my DialogDebuggerVisualizer derived visualizer if I have small
> app which containes the default 'TestShowVisualizer' method generated when
> you create a debugger visualizer in VS 2005.
>
> However, when I copy my dlls into the Program Files\Microsoft Visual
> Studio 8\Common7\Packages\Debugger\Visualizers folder and attempt to use
> it while debugging, creating the control fails in the generated code on
> 'System.Windows.Application.LoadComponent(this, resourceLocater);' with a
> failure to load the treecontrol.baml resource.
>
> In the generated file, the the InitializeComponent code looks like:
>
> public void InitializeComponent() {
> if (_contentLoaded) {
> return;
> }
> _contentLoaded = true;
> System.Uri resourceLocater = new
> System.Uri("Test.Debugging;component\\treecontrol.baml",
> System.UriKind.RelativeOrAbsolute);
> System.Windows.Application.LoadComponent(this, resourceLocater);
> }
>
> I'm a little confused by the ';component' section, because as I say, the
> control works fine when used in other ways.
>
> Anyone have any thoughts?
>
> Thanks,
>
> Chris
>



My System SpecsSystem Spec
Old 01-10-2006   #3 (permalink)
Chris Masters


 
 

Re: WPF in Avalon debugger visualizer

Hello,

The component keyword now makes more sense, however I don't understand why
my DebuggerVisualizer doesn't work.

Perhaps I didn't explain very well. I have an assembly which contains a type
deriving from DialogDebuggerVisualizer (called NodeTreeVisualizer), as well
as a WPF UserControl. The NodeTreeVisualizer contains an ElementHost which
hosts the UserControl. If I test my DebuggerVisualizer OUTSIDE of Visual
Studio's debugger it works by using:

VisualizerDevelopmentHost visualizerHost = new
VisualizerDevelopmentHost(objectToVisualize, typeof(NodeTreeVisualizer));
visualizerHost.ShowVisualizer();

However, once I've copied my DLL and its dependancies into the Visualizers
directory under \Program Files\Microsoft Visual Studio
8\Common7\Packages\Debugger\Visualizers, restarted Visual Studio and
attempted to debug some code, I get the error about not being able to find
the resource when trying to show the visualizer.

It looks to me like a problem in hosting WPF controls in a debugger
visualizer. I can probably come up with a simple example to reproduce and
post if it still doesn't make sense.

Thanks

Chris

"Ashish Shetty [MSFT]" <ashsh@online.microsoft.com> wrote in message
news:u7MZLWADGHA.2596@TK2MSFTNGP10.phx.gbl...
> The Component keyword in the Uri qualifies the reference to the BAML as
> being embedded within that assembly. See
> http://nerddawg.blogspot.com/2005/12...ed-within.html
>
> I don't believe you can address resources embedded in any random DLL
> though. In your case, does the application's project include the DLL as a
> reference? You can add the reference from within Visual Studio or manually
> by adding the item <Reference Include="Test.Debugging" /> to the project
> file.
>
> --
> Ashish Shetty [MSFT]
> Program Manager, Windows Presentation Foundation (Avalon)
> Blog: http://nerddawg.blogspot.com
> ---
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "Chris Masters" <chris@dotnetnews.com> wrote in message
> news:usx$oO$CGHA.3992@TK2MSFTNGP12.phx.gbl...
>> Hey,
>>
>> I've created a pretty simple UserControl which draws a tree of objects
>> onto a canvas, which works fine in a test harness. It also works fine
>> when it's inside my DialogDebuggerVisualizer derived visualizer if I have
>> small app which containes the default 'TestShowVisualizer' method
>> generated when you create a debugger visualizer in VS 2005.
>>
>> However, when I copy my dlls into the Program Files\Microsoft Visual
>> Studio 8\Common7\Packages\Debugger\Visualizers folder and attempt to use
>> it while debugging, creating the control fails in the generated code on
>> 'System.Windows.Application.LoadComponent(this, resourceLocater);' with a
>> failure to load the treecontrol.baml resource.
>>
>> In the generated file, the the InitializeComponent code looks like:
>>
>> public void InitializeComponent() {
>> if (_contentLoaded) {
>> return;
>> }
>> _contentLoaded = true;
>> System.Uri resourceLocater = new
>> System.Uri("Test.Debugging;component\\treecontrol.baml",
>> System.UriKind.RelativeOrAbsolute);
>> System.Windows.Application.LoadComponent(this, resourceLocater);
>> }
>>
>> I'm a little confused by the ';component' section, because as I say, the
>> control works fine when used in other ways.
>>
>> Anyone have any thoughts?
>>
>> Thanks,
>>
>> Chris
>>

>
>



My System SpecsSystem Spec
Old 01-10-2006   #4 (permalink)
Ashish Shetty [MSFT]


 
 

Re: WPF in Avalon debugger visualizer

I've sent this information over to the team. But yes, a simple reproduction
would be much appreciated.

--
Ashish Shetty [MSFT]
Program Manager, Windows Presentation Foundation (Avalon)
Blog: http://nerddawg.blogspot.com
---
This posting is provided "AS IS" with no warranties, and confers no rights.



"Chris Masters" <chris@dotnetnews.com> wrote in message
news:%23xFy3WWDGHA.1384@TK2MSFTNGP11.phx.gbl...
> Hello,
>
> The component keyword now makes more sense, however I don't understand why
> my DebuggerVisualizer doesn't work.
>
> Perhaps I didn't explain very well. I have an assembly which contains a
> type deriving from DialogDebuggerVisualizer (called NodeTreeVisualizer),
> as well as a WPF UserControl. The NodeTreeVisualizer contains an
> ElementHost which hosts the UserControl. If I test my DebuggerVisualizer
> OUTSIDE of Visual Studio's debugger it works by using:
>
> VisualizerDevelopmentHost visualizerHost = new
> VisualizerDevelopmentHost(objectToVisualize, typeof(NodeTreeVisualizer));
> visualizerHost.ShowVisualizer();
>
> However, once I've copied my DLL and its dependancies into the Visualizers
> directory under \Program Files\Microsoft Visual Studio
> 8\Common7\Packages\Debugger\Visualizers, restarted Visual Studio and
> attempted to debug some code, I get the error about not being able to find
> the resource when trying to show the visualizer.
>
> It looks to me like a problem in hosting WPF controls in a debugger
> visualizer. I can probably come up with a simple example to reproduce and
> post if it still doesn't make sense.
>
> Thanks
>
> Chris
>
> "Ashish Shetty [MSFT]" <ashsh@online.microsoft.com> wrote in message
> news:u7MZLWADGHA.2596@TK2MSFTNGP10.phx.gbl...
>> The Component keyword in the Uri qualifies the reference to the BAML as
>> being embedded within that assembly. See
>> http://nerddawg.blogspot.com/2005/12...ed-within.html
>>
>> I don't believe you can address resources embedded in any random DLL
>> though. In your case, does the application's project include the DLL as a
>> reference? You can add the reference from within Visual Studio or
>> manually by adding the item <Reference Include="Test.Debugging" /> to the
>> project file.
>>
>> --
>> Ashish Shetty [MSFT]
>> Program Manager, Windows Presentation Foundation (Avalon)
>> Blog: http://nerddawg.blogspot.com
>> ---
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>> "Chris Masters" <chris@dotnetnews.com> wrote in message
>> news:usx$oO$CGHA.3992@TK2MSFTNGP12.phx.gbl...
>>> Hey,
>>>
>>> I've created a pretty simple UserControl which draws a tree of objects
>>> onto a canvas, which works fine in a test harness. It also works fine
>>> when it's inside my DialogDebuggerVisualizer derived visualizer if I
>>> have small app which containes the default 'TestShowVisualizer' method
>>> generated when you create a debugger visualizer in VS 2005.
>>>
>>> However, when I copy my dlls into the Program Files\Microsoft Visual
>>> Studio 8\Common7\Packages\Debugger\Visualizers folder and attempt to use
>>> it while debugging, creating the control fails in the generated code on
>>> 'System.Windows.Application.LoadComponent(this, resourceLocater);' with
>>> a failure to load the treecontrol.baml resource.
>>>
>>> In the generated file, the the InitializeComponent code looks like:
>>>
>>> public void InitializeComponent() {
>>> if (_contentLoaded) {
>>> return;
>>> }
>>> _contentLoaded = true;
>>> System.Uri resourceLocater = new
>>> System.Uri("Test.Debugging;component\\treecontrol.baml",
>>> System.UriKind.RelativeOrAbsolute);
>>> System.Windows.Application.LoadComponent(this, resourceLocater);
>>> }
>>>
>>> I'm a little confused by the ';component' section, because as I say, the
>>> control works fine when used in other ways.
>>>
>>> Anyone have any thoughts?
>>>
>>> Thanks,
>>>
>>> Chris
>>>

>>
>>

>
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Avalon Concept Windows Live
pspad + free debugger, or simple free debugger ... PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46