Category Archives: MZ-Tools Articles Series

MZ-Tools Articles Series: BUG: Error ocurred in add-in wizard if add-in project created inside solution folder

Don’t you like when you find two bugs in a row? Apart from this other bug, I also found this one using the add-in wizard of Visual Studio, and again the curious part is that it worked in Visual Studio 2005, but was broken in Visual Studio 2008 and the bug persists.

I have reported to Microsoft Connect:

Error occurred in add-in wizard if add-in project created inside solution folder:
https://connect.microsoft.com/VisualStudio/feedback/details/789324/error-ocurred-in-add-in-wizard-if-add-in-project-created-inside-solution-folder

and I have documented in the MZ-Tools Series articles:

BUG: Error occurred in add-in wizard if add-in project created inside solution folder:
http://www.mztools.com/articles/2013/MZ2013004.aspx

MZ-Tools Articles Series: BUG: Checkbox to create CommandBar disabled in add-in wizard if name contains ‘.’

I have created tons of add-ins in the last years using the add-in wizard of Visual Studio, and the other day I wanted to use a project name with a ‘.’ dot character in the name. I noticed this bug that I have reported to Microsoft Connect:

Checkbox to create CommandBar disabled in add-in wizard if name contains “.”
https://connect.microsoft.com/VisualStudio/feedback/details/789323/checkbox-to-create-commandbar-disabled-in-add-in-wizard-if-name-contains

and I have documented in the MZ-Tools Series articles:

BUG: Checkbox to create CommandBar disabled in add-in wizard if name contains ‘.’
http://www.mztools.com/articles/2013/MZ2013003.aspx

The curious part is that it worked in Visual Studio 2005, but was broken in Visual Studio 2008 and the bug persists.

MZ-Tools Articles Series: HOWTO: Get the full browse URL of an .aspx page

I wrote some years ago HOWTO: Open the Web Browser and navigate to a page from a Visual Studio add-in or macro (http://www.mztools.com/articles/2008/MZ2008012.aspx). The other day someone asked in the MSDN VSX forum how to show an .aspx page in the browser programmatically, which is easy if you can get the full browse URL of the .aspx page. It happens that the ProjectItem class of Web Site projects and Web Application projects has different ways of getting / composing the browse URL, so I have written an article with sample code about this:

HOWTO: Get the full browse URL of an .aspx page
http://www.mztools.com/articles/2013/MZ2013002.aspx

MZ-Tools Articles Series updated

Many of the MZ-Tools Articles that I have written in the last years seemed a bit outdated because each one has a header like this:

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio .NET 2002
Date: March 2010   Microsoft Visual Studio .NET 2003

  Microsoft Visual Studio 2005

Where the date and the list of Visual Studio versions would reflect the moment in time when I wrote them.

I have reviewed all them (200+) and many are now updated to reflect that they apply until the last Visual Studio 2012 version when that is the case:

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio .NET 2002
Date: March 2010   Microsoft Visual Studio .NET 2003
Updated: March 2013   Microsoft Visual Studio 2005
      Microsoft Visual Studio 2008
      Microsoft Visual Studio 2010
      Microsoft Visual Studio 2012

So, most HOWTO articles are now current. The exceptions are those articles which are BUG or PRB (issue), that I haven’t bothered to check if they are still present.

MZ-Tools Articles Series: BUG: DTE.ActiveDocument.ActiveWindow does not return the active document window if toolwindow active

My first small article this year is to document this bug of Visual Studio 2005, 2008, 2010 and 2012:

BUG: DTE.ActiveDocument.ActiveWindow does not return the active document window if toolwindow active
http://www.mztools.com/articles/2013/MZ2013001.aspx

Which I have just reported to Microsoft Connect:

Document.ActiveWindow does not return always the active window
https://connect.microsoft.com/VisualStudio/feedback/details/781522/document-activewindow-does-not-return-always-the-active-window

and that is a variation of a bug that I reported for VS.NET 2002/2003 and that I thought it was definitely fixed in VS 2005 (the relevant factor is that it still fails if a toolwindow is active):

BUG: Document.ActiveWindow does not return always the active window in Visual Studio .NET 2002/2003
http://www.mztools.com/articles/2004/MZ2004013.aspx

MZ-Tools Articles Series: HOWTO: Get an inverted bitmap to use with the Dark theme of Visual Studio 2012 from an add-in.

There is a feature in my MZ-Tools add-in that requires to show the pictures of its commands in a treeview, to select which ones to be visible or not. When using Visual Studio 2012 and the Dark theme, the background of the form and the treeview are darked, and the bitmaps should have inverted colors.

I wanted to reuse the command pictures and use a function that inverts their colors as VS 2012 does. I knew the ThemeDIBits method of the IVsUIShell5 interface, but it took me a while to discover a Visual Studio assembly that used it. Finally I found it and here is the approach:

HOWTO: Get an inverted bitmap to use with the Dark theme of Visual Studio 2012 from an add-in.
http://www.mztools.com/articles/2012/MZ2012030.aspx

The sample also shows how to get the background color of toolwindows, using also the IVSUIShell5 interface.

Note: my command pictures use the almost green (RGB=0,254,0) to denote the transparent color, and the sample provided uses that color, but you can use any color.

MZ-Tools Articles Series: HOWTO: Detect Visual Studio requirements for MSI-based extensions setups.

My new article in the MZ-Tools Articles Series is about Visual Studio extension setups (a digression from the “theming extensions” subject of my last articles). I learn something new very often from questions in the MSDN Visual Studio Extensibility (VSX) Forum, when I have to investigate something before providing an answer.

A few days ago a question led me to learn something new that I have documented here:

HOWTO: Detect Visual Studio requirements for MSI-based extensions setups.
http://www.mztools.com/Articles/2012/MZ2012029.aspx

While writing that article I noticed that I had to update a bit these old ones:

HOWTO: Detect installed Visual Studio editions, packages or service packs
http://www.mztools.com/Articles/2008/MZ2008003.aspx

HOWTO: Detect if Visual Studio .NET is installed in a Visual Studio Setup package for an add-in
http://www.mztools.com/Articles/2006/MZ2006001.aspx

MZ-Tools Articles Series: BUG: Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow.

This is one of the bugs that I found while theming my MZ-Tools add-in with VS 2012 Dark / Light themes:

BUG: Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow.
http://www.mztools.com/articles/2012/MZ2012028.aspx

UnthemedScrollbar

And here it is the bug that I have filed through Microsoft Connect to be fixed:

Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow
https://connect.microsoft.com/VisualStudio/feedback/details/766960/visual-studio-2012-doesnt-theme-multiline-textbox-with-initial-scrollbar-on-add-in-toolwindow#details

Fortunately I found an easy workaround that I have mentioned in the article.

MZ-Tools Articles Series: HOWTO: Get the Microsoft.VisualStudio.Shell.Interop.IVsUIShell5 interface to theme a Visual Studio 2012 add-in.

Another building block that I have used to theme my MZ-Tools add-in with the Visual Studio 2012 Dark/Light themes:

HOWTO: Get the Microsoft.VisualStudio.Shell.Interop.IVsUIShell5 interface to theme a Visual Studio 2012 add-in:
http://www.mztools.com/articles/2012/MZ2012027.aspx

In a next article I will explain how to invert the colors of a bitmap like VS 2012 does.

MZ-Tools Articles Series: HOWTO: Theme scrollbars of controls on a Windows Forms modal window from a Visual Studio 2012 add-in.

I had pending for weeks to theme scrollbars of controls of my MZ-Tools add-in on modal forms (Visual Studio 2012 automatically themes scrollbars of controls on toolwindows) and finally yesterday I decided to devote some time to the investigation. Here is the answer:

HOWTO: Theme scrollbars of controls on a Windows Forms modal window from a Visual Studio 2012 add-in.
http://www.mztools.com/articles/2012/MZ2012026.aspx