472,960 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

DebuggerVisualizers

Hi,
Is it possible to target an interface instead of a specific type when
writing a debugger visualizer?

I cant get it to work , everything works fine if i target a class , but if i
target an interface i cant use the visualizer on types that implement the
interface..

Im trying to create a visualizer for runtime emitted types so I cant specify
in advace what types to target.

another problem seems to be if you would apply the visualizer attrib onto my
emitted types, the emitted types would get a dependency to the
microsoft.visualstudio.* dll

Is there anyway to apply a visualizer to emitted types that does not share a
basetype ?

//Roger
Feb 4 '06 #1
4 2147
Ive managed to emit classes with the DebugVisualizer attribute on using a
type name string for the visualizer,

however i get filenot found:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'Puzzle.NAspect.Debug.NET2, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=a8e5914f83beaab3' or one of its dependencies. can not find file
File name: 'Puzzle.NAspect.Debug.NET2, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=a8e5914f83beaab3'
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
Ive read the "installing visualizers" in msdn and tried to put the
visualizer assembly in both the my documents and in the visualstudio
visualizers folder , but I still get the same error.

does the assembly have to be installed in the gac?
Feb 4 '06 #2
Roger wrote:
Hi,
Is it possible to target an interface instead of a specific type when
writing a debugger visualizer?
No. Only classes.
I cant get it to work , everything works fine if i target a class ,
but if i target an interface i cant use the visualizer on types that
implement the interface..

Im trying to create a visualizer for runtime emitted types so I cant
specify in advace what types to target.

another problem seems to be if you would apply the visualizer attrib
onto my emitted types, the emitted types would get a dependency to
the microsoft.visualstudio.* dll

Is there anyway to apply a visualizer to emitted types that does not
share a basetype ?


Add the visualizers to a separate assembly and in that assembly add
attributes like:

[assembly: DebuggerVisualizer(
typeof( SD.LLBLGen.Pro.DebugVisualizers.EntityCollectionVi sualizer ),
typeof( VisualizerObjectSource ),
Target = typeof(
SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionB ase<> ),
Description = "Entity Collection Visualizer" )]

I use a class for the actual visualizer (which derives from
DialogDebuggerVisualizer) and a form class which is the actual
visualizer (form). The assembly attribute has to be placed outside a
namespace declaration so for example below the using statements.

In the example above I also illustrate how you can apply a debugger
visualizer on a generic type. This only works if you specify it as an
'open type', as I showed above.

Your visualizer assembly has references to vs.net assemblies and the
assemblies which contain the types visualized with the visualizers.
This way you can create whatever visualizers you want without having
the visualizer code inside your actual assembly

Be sure the debugger visualizer assembly is placed in one of the two
folders supported for this, see the debugger visualizer documentation
in the vs.net documentation for details on that. THis also goes for the
assemblies REFERENCED by the debugger visualizer, as VS.NET will load
these assemblies on its own, so fusion has to be able to load them on
its own.

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 5 '06 #3
The problem in my case is that the targets are runtime emitted and does not
share a baseclass so I have to decorate them with the debuggervisualizer
attrib.

It turns out that when using fully qualified names vs.net does NOT!! probe
the visualizer folders thus cannot find the assembly.

however, if I put the visualizer into the vs.net/IDE folder the assembly can
be loaded.

BUT, only if I use the "DebuggerVisualizer(string)" ctor,
If I use the "DebuggerVisualizer(string,string)" ctor it wont look in the
IDE folder either and you get file not found there to.

so it seems very much like the debuggervisualzier api is bugged when it
comes to qualified names instead of using types.

//Roger
Feb 5 '06 #4
Roger wrote:
The problem in my case is that the targets are runtime emitted and
does not share a baseclass so I have to decorate them with the
debuggervisualizer attrib.

It turns out that when using fully qualified names vs.net does NOT!!
probe the visualizer folders thus cannot find the assembly.

however, if I put the visualizer into the vs.net/IDE folder the
assembly can be loaded.

BUT, only if I use the "DebuggerVisualizer(string)" ctor,
If I use the "DebuggerVisualizer(string,string)" ctor it wont look
in the IDE folder either and you get file not found there to.

so it seems very much like the debuggervisualzier api is bugged when
it comes to qualified names instead of using types.


aha, this might be the reason why it didn't work when I added the
attributes to the types with strings (and fully qualifified names). I
still couldn't get it work with interfaces though.

Sees we need debugger visualizers for the debugger visualizers api
code ;)

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
sid0404
by: sid0404 | last post by:
Hi I have created a web application which retrieves the data from the webstie, but since the data is too much to grab so occasionally i get the response time out exception as the reason for the...
1
by: Clive Dixon | last post by:
I'm writing my first debugger visualiser, and I'm having to provide my own serialisation as the object I'm examining is not serializable. I also want to be able to modify the object via my...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.