Thursday, February 28, 2008

Visual Studio Gallery Website

Last month Soma posted about MSDN Code Gallery - snippets, samples and resources. Today a new gallery has started off - meet Visual Studio Gallery website! Check out the video on Channel 9: Anthony Cangialosi and Ken Levy: Visual Studio Gallery. 

This website is a one-stop shop for all Visual Studio extensions. It includes everything from free VS PowerToys like tools to VSIP products. Any developer is able to post information and a link to their Visual Studio extensions.

Visual Studio Gallery - Extension Details

All extensions are grouped into categories like Setup & Deploy, Programming Languages, Controls & Libraries, Testing, Web and so on. You are able to search Gallery in specified categories and for a given version of Visual Studio. Know how to see all the VS Gallery extensions from Anthony Cangialosi.

Visual Studio Gallery - Search Gallery

The goal of this website is to give developers an easy way to find extensions for Visual Studio. Visual Studio extensions might include products and free applications in the form of macros, add-ins, packages, project templates, or other types of extensions to Visual Studio that are packaged-up and ready to use by developers to improve their development experience.

To start using Visual Studio Gallery you can just go to the website, click on “My Account” link in the top right corner and sign in with your Windows Live ID to start the process. Publish your Visual Studio Extension on the Visual Studio Gallery today!

Keep in touch and happy extending!

Read more...

Wednesday, February 27, 2008

HOW TO: Change Existing Item Template in Visual Studio

If you don’t like some item templates in Visual Studio, there are two ways to tackle the problem: create a new custom template (recommended way) or change the existing one.

To create a new custom template you should standard functionality of Visual Studio via using File -> Export Template menu. There are two great articles explaining how to do that:

Note that the first way is recommended and using the second one described below may damage your Visual Studio installation.

To change existing template you have to do some manipulations specified below. Further instructions are based on the assumption that we want to change the C# class template for Visual Studio 2005 installed in default location.

1. Find the code file template here:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip

2. Copy original Class.zip file somewhere (and also make a second backup copy of it)

3. Extract copied Class.zip and open Class.cs file in test editor. You should see following:

3

4. Modify the class template you wish. I have removed using directives, added public modifier for class and added the default class constructor:

4

5. Save the changes

6. Archive modified template back using standard Compressed Folder from Explorer:

Compress new Class template 

7. Replace original Class.zip file with new one

8. Open Visual Studio 2005 Command Prompt and execute following command to refresh the templates:

devenv.exe /installvstemplates

9. Open IDE, create a new C# project and add a new class:

2

That's all.

Keep in touch and happy extending!

Read more...

Tuesday, February 26, 2008

It's possible to create a VSPackage with F#

Aaron Marten just posted about the first Visual Studio package he created using functional language F#.

This package is very simple and it only adds a new menu command to the tools menu. But using functional programming for extending Visual Studio looks very promising. Especially for creating new language integration packages - all the stuff related to scanner and parser logic.

Keep in touch and happy extending!

Read more...

Sunday, February 24, 2008

Mouse Gestures add-in for Visual Studio

Today I have noticed in the VSX Forum the post about a new add-in for Visual Studio named Mouse Gestures. Now you are able to use mouse gestures in your favorite IDE!

From author's description:

Mouse gesture is a way of combining computer mouse movements and clicks which the software recognizes as a specific command. Mouse gestures can provide quick access to common functions of a program.

For those of you who use Opera or Mozilla Firefox with mouse gesture extension, that functionality is not new. But if you are still not an addict of mouse gestures, have a look at these links explaining what Mouse Gestures are?

Somebody calls himself LKabrt (thanks a lot) has created an Mouse Gestures add-in the Visual Studio, which allows you to use mouse gestures in the Visual Studio IDE. It works with Visual Studio 2005 as well as Visual Studio 2008. The project is available in source and binary forms under the BSD license on CodePlex website.

You can download the latest add-in sources, binaries or installer from Releases section of project on CodePlex.

Keep in touch and happy extending!

Read more...

Monday, February 18, 2008

Annoying error 'Not enough storage is available to complete this operation'

If you ask Google about this message, you will see that there are a lot of reports that people get that error it in very different situations.

I have got this error working on really big Visual Studio solution. One of the 50 projects has failed during the build process with the message:

Error 1211 Unexpected error writing metadata to file 'SKIPPED_INFO_HERE' -- 'Not enough storage is available to complete this operation'

After a lot of searching, I have figured out that there is a problem with a hard limit of memory per process in windows of 2 GB. This article from Microsoft about Memory Support and Windows Operating Systems. It explains some details about that and contains the tips how to increase this limit to 3 GB.

There is a summary for required steps:

  • Add the /3GB switch to your boot.ini file
  • Open up a VS 2005 command prompt
  • Change directory to the <Visual Studio>\Common7\IDE directory
  • Type command 'editbin /LARGEADDRESSAWARE devenv.exe' and press ENTER
  • Reboot Windows and Build your solution again

Note: it makes sense to backup the files you change - boot.ini and devenv.exe

Keep in touch and happy extending!

Read more...

Saturday, February 16, 2008

Simple Managed Language Service Sample - MyLanguageService

I read a lot of questions in VSX Forum about how to create custom language service using MPF. Most of askers can't figure out how to do that from VS SDK documentation. Most of them would like to play with the sample. I have prepared a very simple sample of managed language service, which I called just MyLanguageService. I hope it will help you to start developing a new language service.

MyLanguageService is a package for Visual Studio 2005, containing simple managed language service. I have used the latest VS SDK 4.0 RTM for Visual Studio 2005. MyLanguageService sample's functionality is to highlight the custom syntax in the files with .my extension.

MyLanguageService - Simple Managed Language Service Sample

Download the sources here: VSXInsider.MyLanguageService.zip

Keep in touch and happy extending!

Read more...

Friday, February 15, 2008

New custom project can't be saved

Working on Neutron, I had the problem with saving Neutron's custom project. A new project has been created in a temporary directory.

A new project has been created in a temporary directory

When I try to save whole solution the old style save project dialog box appears.

An old style save project dialog box appears

But after specifying the name and directory to save the project, and pressing on Save button and get the error dialog with following message:

The operation could not be completed. No such interface supported

The operation could not be completed. No such interface supported.

After some research the work around this weird problem has been found. To prevent this strange behavior all of you need is go in Tools -> Options -> Projects and Solutions -> General and check 'Save new projects when created' option.

Save new projects when created

This will not affect projects already opened. But that will prevent new ones from the problem we are discussing.

As you can see, just a work around is described in this post. I have reported this bug to Microsoft Connect last year. You can see my feedback here: Solution is not saved when "Save new projects when created" is unchecked. But the real fix for that bug is still not ready. You can add your 2 cents by voting for it! ;)

Keep in touch and happy extending!

Read more...

Wednesday, February 13, 2008

Upgrading VS 2005 Packages to VS 2008

Once Visual Studio 2008 (aka Orcas) has been released, all extenders are focused on this new IDE. The last VS SDK version for Visual Studio 2005 (aka Whidbey) has been prepared, and all further VS SDK versions deal with VS 2008.

The top question still is "How to upgrade my package to be compatible with Orcas?"

James Lau prepared two great guides helping VS extenders to do that:

Keep in touch and happy extending!

Read more...

Sunday, February 10, 2008

Do you have anything to say about Visual Studio performance?

Today I have read the post at VSEditor's blog that Holden Karau joined to the Visual Studio platform team.

Holden Karau is a new Performance PM intern on the team. As Holder said in the post:

"I really want to here anything you have to say about VS performance..."

So if you have any - do that!

Keep in touch and happy development!

Read more...

Friday, February 8, 2008

Failed to retrieve paths under VSTemplate for the specified registry hive

If you are getting "Failed to retrieve paths under VSTemplate for the specified registry hive" error building the Visual Studio 2008 SDK samples, have a look at Aaron Marten's blog post "Remember to reset your Experimental hive".

Keep in touch and happy extending!

Read more...

Wednesday, February 6, 2008

Adding VSCT compilation support to Whidbey (VS 2005) projects

This post demonstrates how to add VSCT support for Whidbey (VS 2005) projects.

About a month ago Aaron Marten wrote a post “CTC is dead...Long Live VSCT! (Part 1)” where he announced a new XML-based format called VSCT, which is far easier to work with than CTC. Two weeks ago James Lau announced VS SDK for Orcas Beta 1 (April CTP). One of the improvements of April CTP is that command table configuration (.ctc) files have been deprecated in favor of XML command table (.vsct) files and all samples that used .ctc files have been converted to use .vsct files.

Well, that is good but it is done for Visual Studio Codename Orcas only. The latest VS SDK 4.0 RTM for Visual Studio 2005 announced a little bit earlier still uses CTC but it includes VSCT compiler in pre-release state. You can find it here: C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\.

To demonstrate how to add VSCT support for Whidbey (VS 2005) projects we will use the C# Reference.MenuAndCommands sample included into Visual Studio SDK Version 4.0. You can find it in that directory: C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Samples\IDE\CSharp\Reference.MenuAndCommands\. At the end of this tutorial, we will get this sample working with VSCT instead of CTC. Follow instructions below.

1. Before we will substitute CTC with VSCT let’s see how it looks now. Press F5 to run the MenuAndCommands sample in experimental hive and see some menu items added under main menu item ‘Tools’. Note command ‘C# Command Sample’ – it will be our marker in this tutorial.

Before (with CTC)

2. The first thing we should care about is to obtain VSCT analogue for our CTC file. The easiest way to do that is to build the project to get .cto file compiled from current .ctc file and then create a .vsct file from an existing .cto file using VSCT.exe utility. I have used the following command to perform the conversion from <project_root>\obj\Debug\ directory where two input files PkgCmd.cto and PkgCmd.ctsym are located.

> "C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\VSCT\VSCT.exe" PkgCmd.cto PkgCmd.vsct -SPkgCmd.ctsym

3. Now let’s replace CTC part of the MenuAndCommands sample project with VSCT analogue. Create new folder VSCTComponents under project root directory and copy just generated PkgCmd.vsct file from obj\Debug\ there. Then make it part of the project. To be sure that we have no CTC here let’s remove all from CtcComponents folder except image GenericCmd.bmp, because it is still needed. Let’s also replace the text of the button ‘C# Command Sample’ with ‘C# Command Sample (VSTS)’ to have some differences in resulting UI. See what we have now.

Change the button text to have a visual marker

Note: you can easily add IntelliSense for .vsct files via browsing for C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\VSCT\VSCT.xsd file in ‘Schemas’ property in Properties window (accessible by F4).

4. Rebuild the solution and then execute ‘devenv.exe /rootsuffix Exp /setup’ command to refresh Visual Studio UI. Then press F5 to see the result – all menus disappeared. To get all back in VSCT incarnation of menu items we need to write some code right in MenuAndCommands.csproj project file. To do that unload the project and open it for editing using ‘Edit MenuAndCommands.csproj’ command.

Open project file for manual editing

5. Add the following line importing .targets file as it is shown on the picture below. I have prepared the VSCT_overrides.targets file, so you just need to download it and save in the project root directory.

Import .targets file containing overriden MSBuild targets

6. Now our PkgCmd.vsct file declared as <None Include="VSCTComponents\PkgCmd.vsct" /> in MenuAndCommands.csproj file. Replace this line with the following code. Child node ResourceName specifies the name of CTO object which will be merged into assembly resources with.

Use VSCTCompile tag for .vsct file

7. Save the changes and reload the project. Select ‘Load project normally’ option in the Security Warning dialog which will be appeared. Rebuild the project and see results in output window. There are 4 errors that occurred due to automatic generation.

Four errors of automatic VSCT file generation shown in Visual Studio Output window

Note: make sure you use ‘Normal’ level of MSBuild build output verbosity.

8. You can easily fix them by adding 4 IDSymbol tags under according GuidSymbol tags or just download fixed version of PkgCmd.vsct file I have prepared. Then build the project again and verify that all errors go on.

VSCT file compiled with no errors

9. Rebuild the solution and then execute ‘devenv.exe /rootsuffix Exp /setup’ command to refresh Visual Studio UI. Then press F5 to see the result – menus appeared again. Note the changed text ‘C# Command Sample (VSTS)’.

After (with VSCT)

Keep in touch and happy extending!

Read more...

Enter the world of Visual Studio Extensibility now!

The Visual Studio Extensibility world consists of 3 parts: Macros, Add-ins and Packages. Look at good explaining the various levels of Visual Studio extensibility at Dr. eX's Blog : Visual Studio Extensibility Demystified.

To start working on your extension I would recommend you to keep the following roadmap:

Keep in touch and happy extending!

Read more...

Tuesday, February 5, 2008

Welcome to the VSX Insider's blog!

I started learning the Visual Studio Extensibility (VSX) a year or two ago. This was called as Visual Studio Integration Program (VSIP) those days. The home for VSX is the VSX Developer Center with the VS SDK download, documentation, news, resources, community references, and more.

I decided to start this blog for sharing my experience related to the Visual Studio Extensibility world. For those of you that would like to know about myself, please visit my personal website.

Stick around if you want to read more about topics such as Visual Studio Extensibility (VSX), Visual Studio Software Development Kit (VS SDK), Managed Package Framework (MPF) and other related ones.

Welcome to the VSX Insider's blog!

Read more...