![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Avalon Concept | Windows Live | |||
| pspad + free debugger, or simple free debugger ... | PowerShell | |||