Mittwoch, 30. Januar 2008

How to add a Wizard to a Visual Studio 2008 Project Template

Following the description in How to: Use Wizards with Project Templates I always got this "Error: this template attempted to load an untrusted component" error.

I added my assembly to the GAC and built it with a strong name. I finally found a solution to this problem. My -tag was missing processorArchitecture=msil part.

CustomWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=74329847392 didn't work, but
CustomWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=74329847392,processorArchitecture=MSIL did just fine.

Donnerstag, 17. Januar 2008

Visual Studio 2008 SDK Goodies #2

In ProjectOptions.cs in the Managed Package Framework of Visual Studio 2008 SDK you'll find funny field definitions, e.g.:

/// must be an int if not null
public object CodePage;


Why don't they just define it as an int and define some value or exception indicating, that CodePage is not set?

Mittwoch, 16. Januar 2008

Visual Studio 2008 SDK Goodies #1

When working with the Visual Studio 2008 SDK I found several remarkable places in the documentation and also in the source code of the MPF (Managed Package Framework). I'll post them in this blog the next days.

Today's Goodie can be found in several differnt Interfaces which have to be implemented for integrating into Visual Studio. You'll find a whole bunch of interfaces with reserved1() to reserved10() and unused1() to unused10() methods.

E.g. in IVsTextLines:





Reserved1Reserved in the Vtable for future use. (Inherited from IVsTextBuffer.)
Reserved2Reserved in the Vtable for future use. (Inherited from IVsTextBuffer.)
......
Reserved10Reserved in the Vtable for future use. (Inherited from IVsTextBuffer.)



That's really awesome. Don't the guy's in the different teams at Microsoft know each other?

Donnerstag, 3. Januar 2008

How to identify menus and commands in Visual Studio 2008

From Visual Studio 2005 SP1 on, there's an undocumented registry switch to enable debug messages which show the guid and id of a selected menu or command. To enable this hidden switch, you'll have to add a dword registry entry under [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\General] which is called EnableVSIPLogging. It should have a value of 0x00000001 (hexadecimal 1).

After restarting Visual Studio 2008, you can now identify menus and commands by pressing STRG+SHIFT and clicking on the menu or command.

For instructions on enabling this for Visual Studio 2005, see this article.

Mittwoch, 2. Januar 2008

VSCT file format in Visual Studio 2008 SDK

Hilton Giesenow has made a fantastic How to video about the new vsct-file format which Microsoft is using in Visual Studio 2008 SDK. In contrast to other how to videos, just showing how to use the VsPackage wizard, Hilton shows every step manually. So you'll get a fare good understanding on each part.

You can find the video here.

Reach me via Live Messenger