What visualizer is currently used - visual-studio

On the internet (Microsoft website, e.g.), there's plenty of information on how to create a visualizer.
However, I'd just like to know, which visualizer is currently used by my debugger?
For Native code, that question is very simple:
Menu "Tools", "Options", "Debugging", "Output window", "General Output Settings", "Natvis diagnostic messages", set to "Verbose".
In the Watch-window, enter .natvisreload
Verify the "output" window: all native visualisers are mentioned.
However, now I'm working with managed code, and in my watch-window, I see entries like:
{User Info: 12 User(s), 6 Group(s)
{VDX File Change Info (117 files)}
…
Those entries give me the impression that for this managed code, a/some visualiser(s) is/are used, and I'd like to customise, expand or modify it/them, but therefore I need to know where it/they is/are (sorry for the bad sentence, I just want to emphasize that I have no clue of the whereabouts of the visualiser(s)).
How can I know which managed visualizers are used in my Visual Studio session?
Thanks in advance
Dominique

You'd have to integrate with the debugger and see what types are being evaluated in the watch/autos/locals windows.
From there you can find those types in the list of modules loaded (using debugger apis) and then search for the attributes that Leo mentioned.
There's no debug output anywhere about which type visualizers are loading for managed code. It's actually stored on the types themselves.

How can I know which managed visualizers are used in my Visual Studio session?
According to the document Create custom views of managed objects:
In C# and Visual Basic, you can add expansions for custom data using DebuggerTypeProxyAttribute, DebuggerDisplayAttribute, and DebuggerBrowsableAttribute.
In .NET Framework 2.0 code, Visual Basic does not support the DebuggerBrowsable attribute. This limitation is removed in more recent versions of the .NET Framework.
DebuggerTypeProxy Attribute
DebuggerDisplay Attribute
Hope this helps.

Related

How to Get Some Basic Info from a DLL File?

Assume you have a .DLL file, and you want to know some basic information regarding it,
for example:
Is it a Managed (.NET) or Non-Managed (e.g. COM, etc) DLL
If it's Managed, what minimal version of .NET it requires
(and if it's non-managed, then any other minimal version that it requires? for example minimal version of Windows, or of something else)
Any other kind of such metadata
Please note that I am less interested in seeing the Function Headers (or Classes) that are inside.
Visual Studio's Object Browser can show the Functions/Classes very well,
yet I did not find a way to make Object Browser show the metadata that I mentioned above..
So maybe another utility can do it?

How to (re-)generate ActiveX Wrapper Classes with Visual Studio 10

... especially in the case of Non-Dialog Containers?
Hi folks,
I want to use ActiveX controls that are created in a view, not in a Dialog container, as described in http://msdn.microsoft.com/library/191es2w5%28v=vs.100%29.aspx . But in that article, the existence of the wrapper class is already supposed / not mentioned how to generate it. In the project that was handed me over, i found such generated classes.
For Dialog-Containers, the generator runs when I add a control varaible for the embedded activeX control, (again: not mentioned in msdn doc http://msdn.microsoft.com/library/w98bewhf%28v=vs.100%29.aspx ). Workaorunds are possible (eg. creating a useless dialog just for that purpose), but there must be a "clean" way in Visual Studio!? I am a little bit disappointed by the MS-Documentation I found. If somebody could give me a hint, you could make me happy...

Is it possible to programmatically set trace points in VS 2010?

This is in reference to the Visual Studio automation interface. It is possible to set breakpoints in a program using the method:
EnvDTE.Debugger.Breakpoints.Add(...)
However, I don't think it's possible to configure trace points this way. Any ideas?
Check out the answers in this post particularly the BreakWhenHit = false, Message, and Macro properties of the Breakpoint2 interface.
Or you could also look at a logging framework like Log4Net.

Create Language Service for VisualStudio 2010

I want to build a language service for visual studio 2010. I was first trying to follow the tutorial and documentations from MSDN.
The problem is i don't succeed to make this works (i'll explain later my problem). So i digged into existing implementations, i found Ook! and lua . both of these projects doesn't use the tutorial or documentation i found on MSDN, but something based on MEF. Lua used this only with previous Visual Studio versions.
So i'm wondering if i'm using an obsolete method to create a language service (But the documentation aims Visual Studio 2010), or there is different ways to do this, which depends on needs.
In my case, i've got a language that doesn't need to be compiled into cli, but i want to have an editor that have colorization, syntax warnings and errors, intellisense ...
The problem i mentionned is that when launching exp instance, there is no text editor with my file extension, and visual studio begins to have many lags. The language service is registered using 3 attributes : ProvideServiceAttribute, ProvideLanguageServiceAttribute and ProvideLanguageServiceExtension. Also initialized in Package intialize method, like mentionned in Proffer the Language.... The package is loaded when i try to open the file with my extension, the language service is initialized.
So i don't get it why i does not work, could you please help me to understand how language service works, and what is the best way to implement it
Thanks
Good chance your IScanner implementation has an endless loop, happened to me.

visual studio: is it possible to color custom tags in code?

Is it possible somehow to color specified code in specified color in any version of visual studio? For example, make background of
if( VERIFY( ... ) )
green and background of
if( ! VERIFY( ... ) )
red? Maybe some addon exists or some version of visual studio has such functionality?
NO PLUGIN NEEDED
According to MSDN and this tutorial, you can set user-defined keywords for syntax highlighting in a
usertype.dat file, which you should save in the same directory as Visual Studio's msdev.exe, or devenv.exe for VS.NET.
Now restart Visual Studio.
Then in VS you can set the font properties for those keywords.
Edit: BTW, see the download here for a predefined usertype.dat with a lot of keywords ready to use.
You can use Resharper's "ToDo Items" to accomplish this.
Resharper -> Options
Create a pattern.
Here you can specify the color, pattern, icon etc. This should already give you colorized code, the rest is optional, but makes it easier to find the patterns.
(look at existing patterns for the syntax, or check the docs)
You can use filters to find the patterns, and combinations of patterns
You could create a filter that contains both your patterns for instance.
use Resharper -> Tools -> ToDo-Items to search for the patterns
I don't know of an existing addin that does anything like that but I do know that Developer Express, the company that makes CodeRush, makes the addin engine freely available as a product called DxCore. This makes is much easier to create an addin that decorates the Visual Studio text editor. In Visual Studio 2010, a lot of the extremely difficult code that DxCore abstracts is no longer necessary as there is an official extensibility model for decorating the editor.
Here's a link to some DxCore plugin samples on Google Code.
No, but you may be interested in FxCop, it's more elaborate, but it should allow you the ability to detect the case you're talking about (via a custom rule, if it doesn't exist). It may be more work to set up, but it's worth it (especially if work in a team, and/or, have an existing CI system).
According to the VS Extensibility form Moderator, Ed Dore, it is not possible:
http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/93fc6d61-cfdb-432d-8541-d7dce498cef5/
Unfortunately, no. The code implementing the document tabbing was developed with native Win32 code, and currently doesn't have any VS SDK or automation hooks into it.
It is too bad as this would be beyond useful. (Keep track of different types of files and such.)

Resources