Welcome to MSDN Blogs Sign in | Join | Help

Pedro Silva's Blog

Development lead on Visual Studio Platform team focusing on the extensibility of Visual Studio.

Syndication

News

My name is Pedro Silva. I’m the development lead in the Visual Studio Platform team at Microsoft, working on VS Extensibility features, enabling VS extensions and the VS SDK.

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Cool Extension: SQL Azure Explorer

I was just looking through some new extensions on the Visuals Studio Gallery for VS2010 Beta 2 and came across this one: the SQL Azure Explorer by Johan Danforth. This extension creates a tool window in Visual Studio similar to the Server Explorer, that lets you manage SQL servers exposed through the Azure cloud services. You can create databases and tables, edit columns, view and edit data... It's all very cool. The SQL Azure Explorer also lets you edit queries and write stored procedures in a SQL Editor.

Posted Friday, November 06, 2009 9:45 AM by PedroSilva | 0 Comments

Filed under: , ,

Visual Studio 2010 SDK for Beta 2 Now Available!

The Visual Studio 2010 Beta 2 SDK is now available for everyone to use from the Download Center. So, install it (it's quick), and start building you very own extensions to Visual Studio today! And once you have those extensions ready to share with world, post them up on the Visual Studio Gallery.

 

In addition to shipping the VS SDK Beta 2 on the same day as the product, we have also released the Beta 2 Integrated and Isolated shell redists, and the DSL team have shipped the Beta 2 DSL tools as well.

Posted Wednesday, October 21, 2009 11:36 AM by PedroSilva | 0 Comments

Visual Studio 2010 Beta 2 Available

We announced today the availability of the Visual Studio 2010 Beta 2 on MSDN. Later this week, on Wednesday, it will generally be available for everyone from the Download Center. There has been a ton of work, performance improvements, and bug fixing done for Beta 2, so definitely check it out and provide us feedback on what you like and don't like.

And, along with MSDN, the Visual Studio Gallery has gone through a redesign. Also, VSIX extensions available on the Gallery are now on for Beta 2.

New for the extension manager in Beta 2, we went through a UI redesign to make it appear more like the new Visual Studio shell and consistent with the New Project dialog; updated the vsixmanifest format; added support for Toolbox controls and VS Start Pages to VSIX; and fixed a slew of bugs.

Posted Monday, October 19, 2009 3:40 PM by PedroSilva | 0 Comments

Filed under: ,

Cool Extension: Vim Emulation

Jared just released a cool new editor extension for Visual Studio 2010 Beta 1 to provide Vim editor emulations. You can find this on the VS Gallery and through the Extension Manager in VS 2010, so go test drive it today.

He also talks more about what this extension currently supports and where he's going with it on his blog. And, sounds like he plans to also release the source code for it as well some time soon...

Posted Wednesday, September 09, 2009 11:36 AM by PedroSilva | 0 Comments

Filed under: ,

Online Templates for the New Project Dialog

ScottGu recently posted about the new online templates feature of the Visual Studio 2010 Beta1. The discussions on his blog have been pretty lively, and mostly folks seem to like this new feature.

The Online tab of the New Project Dialog is built on the same infrastructure as the Extension Manager. It uses the same UI and installation technology (VSIX packages) as other extensions. They're hosted on the VS Gallery as well (under the Templates category). And, they're queryable on the Gallery through their web service. All of the earlier posts I made about how to create template extensions give step-by-step directions on how to create templates of your own.

I'm glad to see folks are starting to see the value in these new online features. And, I hope that for Beta 2 we will see a larger influx of customer uploaded templates, and that these ASP.NET starter kits will also be on the gallery, so our customers can use them seemlessly.

Posted Friday, August 28, 2009 11:27 AM by PedroSilva | 0 Comments

New Project templates of VS-MEF integration

Pablo Galiano has just published two you project template extensions for the Visual Studio Gallery, both of them for doing MEF integration with Visual Studio 2010 Beta 1. Check them out:

Give them a try... you can get them in the product through the Extension Manager.

Posted Monday, July 13, 2009 1:55 PM by PedroSilva | 0 Comments

Filed under: , ,

MPF for Projects released for VS 2010 Beta 1
Chuck England has just recently posted the sources for MPF for Projects on CodePlex. If you're interested in creating your own project systems for Visual Studio 2010 Beta 1, this is the place to start. And, for those of you wishing to port your project systems from VS 2008 to 2010, the sources will give you a good idea of what types of changes will be necessary. There have been several requests for a Beta 1 version of this component, so I hope you will find it useful.

Posted Thursday, July 09, 2009 6:29 PM by PedroSilva | 0 Comments

Filed under: , ,

Look Ma, No More PLKs!

For those of you trying out Visual Studio 2010 Beta 1, you may have already noticed... But, Visual Studio 2010 no longer requires you to create Package Load Keys (PLKs) for writing and deploying VSPackage extensions to VS. This will probably come with some fanfare by those of you who've had trouble with PLKs, or getting your packages to load because of them, or never understood why they were needed anyway.

The requirement for Shell Load Keys (SLKs) has also been removed, so you can create new isolated shells without them.

For those of you who have no idea what PLKs/SLKs are, then no need to worry... :)

Posted Friday, June 19, 2009 1:35 PM by PedroSilva | 2 Comments

Update to AboutBox Extension

I recently posted an update the the WPF AboutBox (CS) extension (v 0.4) on the VS Gallery. You can find it by launching the Extension Manager in Visual Studio 2010 Beta 1. If you've already previously installed it, then click on the Updates tab on the left hand side of the dialog. This will query the Gallery for any updates to the extensions you already have installed. Notice that the WPF AboutBox (CS) should now appear there.

Also, you may notice that I recently posted a WPF AboutBox (VB) extension too. So now you can add this AboutBox to your VB apps too.

Posted Wednesday, June 10, 2009 7:46 AM by PedroSilva | 0 Comments

Filed under: ,

Aaron Posts on VSIX Project and pkgdef Files

Aaron (one of the developers on my team working on the SDK) just wrote a couple of great posts for folks wishing to use and to understand how the SDK works for VS 2010 Beta 1. Definitely worth a read if you're working on VS extensions:

Posted Tuesday, June 09, 2009 8:51 AM by PedroSilva | 0 Comments

Filed under: , ,

Creating an Item Template Extension (Addendum)

There are a couple of other ways to create project/item template extensions besides using the VSIX Explorer. So, I’m going to give some quick steps here for folks that would like to use an alternative… Just replace Part 2 of my earlier posts with either of the ones described below.

A – Using VSIX Project Template

The VSIX Project template is shipped with the VS SDK. You can install the SDK from MSDN Download Center.

To use the template, launch the New Project dialog and navigate down to Visual C# (or Visual Basic) > Extensibility node. And, select VSIX Project from the list. This will create a new blank Extension project.

In the Solution Explorer, right click on the Project (VSIXProject2), and select Add > New Folder. It doesn’t matter what you name it, but for our example I’m using “Item”.

In that folder, you need to add a zipped up template file. To do this, right click on the folder, and select Add > Existing Item. This brings up a File Open dialog, so navigate to where we created our Item template from Part 1. [Note: Be sure to change the file filter to All Files (*.*) or you might not see your template.]

One thing you *MUST* do to make this packaging work is tag the template zip file to “Copy to Output”. Select the zip file (WpfAboutBoxCS.zip), and view its properties. In the Property tool window, change the Copy to Output Directory property to Copy Always. The build tools for this project, put everything in the output folder into the built VSIX file, so if you don’t do this, your template won’t be part of the VSIX file.

You can then edit the VSIX manifest data in an editor that’s shipped as part of the SDK. Just double-click the extension.vsixmanifest file in the Solution Explorer.

This is very similar to editing the metadata in the VSIX Explorer, except that it has better binding support, so you don’t need to drop into XML to edit it by hand. So, I won’t go into too much detail about each field. But, you’ll notice that the Content section of this page is plugged in, so we can edit the content of your VSIX more easily. Also, the icon and preview image starts with the defaults, but you can either add your own images to this project, or just edit the icon and preview image files that are in this project.

Now, build the solution, and you will get a VSIX file in the output directory (.\bin\Release). You can navigate through the Windows Explorer to find the file under your project directory.

The one issue with following this process is that the VSIX Project also builds an empty assembly in addition to the template. So, the VSIX file actually contains a DLL and PDB file that was output from this project. This is not great because you would be installing it on the end user’s machine even though they are unnecessary.

Thanks to Aaron for the following work around to get the unnecessary DLL & PDB files not to be packaged into the VSIX:

Preventing the DLL/PDB from being added to the VSIX

One thing you may notice is that the DLL and PDB built from the project (that you don’t need if you’re just packaging up some templates) gets included in the VSIX file. To suppress this, you could either use the VSIX Explorer tool to edit the file post-build (tedious since you need to do this for each build)…or simply add the following XML snippet to your CSProj/VBProj to prevent the DLL or PDB from being included in the VSIX file at all:

<PropertyGroup>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<SkipCopyingSymbolsToOutputDirectory>true</SkipCopyingSymbolsToOutputDirectory>
</PropertyGroup>

B – Raw Editing of VSIX

As I mentioned in earlier posts, the VSIX file is just an OPC compound file. This file is actually compatible with a ZIP file. So, you can create a VSIX just by starting with a ZIP file.

Create a new ZIP file in the Windows Explorer by right clicking on a folder and selecting New > Compressed (zipped) Folder. Name it to the extension name you desire.

Copy in the contents that you want in your extension zip file: the icon, the preview image, the Item folder, and the zipped up template (under that folder).

Now, you need to create an extension.vsixmanifest file at the root of the ZIP file. This is an XML file that describes your extension… the data that you want to publish about it, and what components make up your extension. In the previous steps, we’ve used GUI editors to edit this file, but you can just create the raw XML as well. For the AboutBox template that we’ve been working with, the following XML will be needed:

<?xml version="1.0" encoding="utf-8"?>

<VSIX xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">

  <Identifier ID="WpfAboutBox.CS">

    <Name>WPF About Box (CS)</Name>

    <Author>Pedro Silva</Author>

    <Version>0.4</Version>

    <Description>Every application has an AboutBox, but there isn't a common one for WPF Applications... until now.

    Create an AboutBox for a WPF Application. Use assembly attributes in your project or XML data in your resources

    to control what data is displayed in the dialog.</Description>

    <Locale>1033</Locale>

    <Icon>WpfAboutIcon.png</Icon>

    <PreviewImage>WpfAboutPreview.png</PreviewImage>

    <SupportedVSEdition version="10.0">

      <Edition>Pro</Edition>

      <Edition>VCSExpress</Edition>

      <Edition>VST_All</Edition>

    </SupportedVSEdition>

    <SupportedFrameworkRuntimeEdition minversion="4.0" maxversion="4.0" />

  </Identifier>

  <References />

  <Content>

    <ItemTemplate>Item</ItemTemplate>

  </Content>

</VSIX>

As you can see, the XML for this extension is fairly concise, and the Elements and Attributes map pretty cleanly to the UI you’ve seen earlier. Also, in Visual Studio 10, we are shipping the XSD for the manifest, so you will get intellisense when you edit a file of this type. I’m not going to go into each entry in the XML, you can look at the schema or Help documentation, if you’d like to know exactly what everything does.

Then, you need to create a special file called [Content_Types].xml, that’s used by the packaging API. This file is always the same for templates, so feel free to duplicate the XML below in your template extensions.

  <?xml version="1.0" encoding="utf-8" ?>

- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">

               <Default Extension="vsixmanifest" ContentType="text/xml" />

               <Default Extension="zip" ContentType="application/octet-stream" />

               <Default Extension="ico" ContentType="application/octet-stream" />

               <Default Extension="png" ContentType="application/octet-stream" />

  </Types>

Finally, just rename you NewExtension.zip file to NewExtension.vsix… and voila you now have a packaged up VSIX extension. Double clicking it will go through the local installation process, or you can now upload it to the VS Gallery. This is quite a bit of manual intervention, and has the possibility for errors in the extension.vsixmanifest and [Content_Types].xml files. But, the cool thing is that you could do it by hand if you had to.

I hope you enjoyed these alternatives for creating VSIX packages. These were shown for creating templates in particular, but the same principles hold for all new Visual Studio 10 extension types. And, with subsequent Beta and RTM releases of the product and SDK, I’m hoping that these posts won’t even be needed in the near future. J

 

Posted Monday, June 08, 2009 8:48 PM by PedroSilva | 3 Comments

Creating an Item Template Extension (Part 3)

The VSIX file we created in Part 2 is the new unit of deployment for extension in Visual Studio 2010. VS knows how to install these types of extensions, and the VS Gallery is a place where you can host them. Also, the contents of the Gallery are then discoverable from within Visual Studio.

Step 6 – Publishing Your Extension

To publish your extension, point your favorite web browser to: www.visualstudiogallery.com. You must log into the site, using a Windows Live ID. If you don’t have an ID, it’s easy to create one for a hotmail account. After you’ve logged in… near the top of the page, just below the main header, you’ll find a link to “My Contributions”.

Click that link, and it will bring you to a page that lists all of the extensions that you have posted to the Gallery.

On the right side of that page, you will see an Upload button. Click that button to begin the upload process…

First, select the extension type that we’re posting. In this case it’s the Project or Item Template entry. Control is used to designate toolbox controls. And, everything else is a Tool.

Then, enter the path to the VSIX file that you want to upload. The Browse button brings up a File Open dialog to help locate your VSIX file. There is validation performed on the VSIX file you’re about to upload. If there are errors in your VSIX metadata file, you will get error messages when you click the Next button.

The fields on the left (Title, Summary, Version, Thumbnail, etc) are retrieved from you VSIX manifest file and populated on this page (if you want to change those, you need to go back and edit the VSIX manifest for your extension). You need to fill in the rest:

·         Category: corresponds to the categorization scheme on the Gallery. This is WPF template, so we only selected that one.

·         Tags: you can tag your extension with additional keywords. These keyword tags are used during Search, so they may make finding your extension easier.

·         Cost Category: This can be either Free, Free Trial, or Paid. (Note: Paid can only really be used with Reference Links… there is no mechanism for paid extensions hosted on the Gallery).

·         Description: this is a free form field where you can be as descriptive as you’d like about your extension. This description is only shown on the website. In the Extension Manager, you only ever see the Summary of your extension.

Once you are done entering your extension information, read and check the “I Agree to the Contribution Agreement” checkbox. Then, you can click the Create Contribution button.

When you return to the Contributions page, you will now see your new extension listed there…

You’ll also notice that each extension has links to edit them again (you can update your description and tags as much as you’d like), and unpublish or delete (if you do not want your extension on the Gallery any longer). Plus, Stats lets you see how many times your extension has been downloaded.

Note: If you make updates to your extension, you need to come back to this Contributions page and select Edit, to upload a new version of the extension. Please be sure that the extension has a new version number, so the Extension Manager will know it’s an update.

Conclusions

These posts have given you the nitty-gritty details for preparing and publishing a template for Visual Studio 2010. Unfortunately for Beta 1, the process for templates is a little bit cumbersome because it wasn’t the focus of the tools we built into the Visual Studio SDK. But running through these steps as I was working on these posts has made that quite obvious to me and a few other folks. So, we are looking at a few things that will make this process a whole lot easier for Beta 2.

But, I’m really looking forward to people following these steps, and producing lots of new templates for all Visual Studio developers to use.

Finally, the SDK tools for building packages, tool windows, and editor extensions have really streamlined this process. The project templates we have to build packages and editor extensions, automatically build a packaged up VSIX file every time you build your extension, so all you really have to do is build the extension and upload the VSIX file in its output directory. And, there is a VSIX manifest editor that lets you easily edit all of the metadata about your extension. So, give those tools a try for you non-template extensions.

 

Posted Sunday, June 07, 2009 1:22 PM by PedroSilva | 1 Comments

Creating an Item Template Extension (Part 2)

Now, that we have a zipped up item template (from Part 1), how do we get this thing ready for the VS Gallery? All uploads hosted on the Gallery need to be VSIX files. I’m not going to talk much today about the file format (that is a full topic of its own), but you can read some about it on Quan’s blog. Just suffice it to say it’s a compound file (OPC package) that can contain any number of files within it.

Wouldn’t it be nice to have something that let you view and create the contents of a VSIX file… well, luckily, there’s an extension for that. J Gearard and Mariano (a QA and dev from our team) created the VSIXExplorer to allow users to view and edit the VSIX files that we work with.

From the Extension Manager (found under Tools menu > Extension Manager) go online, find, and install the VSIXExplorer. This little tool lets you view and edit the contents of a VSIX file. Launch it from Tools > VSIXExplorer. This tool is still very much under development, so it’s still a little rough around the edges, but you can expect additional updates as we flesh it out.

Step 3 – Creating a VSIX File

First, start the VSIXExplorer, and select File > New to create a new empty VSIX file. It will ask you to select a name for the VSIX file right away. And, as you’re editing the internal structure, changes are being made directly to the VSIX file. Notice that it shows the VSIX file as the root of the treeview (in this case our “WPF AboutBox (CS).vsix”), and a single extension.vsixmanifest file in it.

First step is to add some other elements to this file. You can either:

·         Drag and drop files from the Windows Explorer to the VSIXExplorer, dropping onto the root VSIX node.

·         Or, right click on the root node and select Add > Existing File.

For templates, you should add icon and preview images (using either method above – though I had better luck with the context menu). And, templates have an extra requirement of the template being inside a subfolder. I’m not going to go into the dirty details of why, but it’s a requirement of the current template engine that we could not change for VS 2010. So, in my example, I created an “Item” folder (using Add > New Folder). Then place the template zip file in that folder. This is all of the structure and files you need for a template extension.

Note: This template will appear in the C# (or VB) general tab of the New Item dialog. That dialog has a tree with more specific categories, like Web, Windows Forms, and WPF. If you wanted your template to show up only in the WPF category, you can do this by making the folder structure in the VSIX file (ex: Item\WPF would show your template when the WPF category is selected). One drawback is that it would only show up in a single category, so for my sample, I decided to keep it at the root.

Step 4 – Editing the VSIX Manifest

When you select the extension.vsixmanifest node in the treeview, you will see a set of property pages that allow you to edit the manifest.

 

The interesting properties on this tab are ID and Version. Be sure that the ID is unique, this is used by the Extension Manager and Gallery as the unique identifier of your extension. Duplicates are not allowed on the Gallery, and you will be warned when you upload your extension. Also, version is important for updates. If you change your extension, you should increment the Version number. That way, if a user already has installed your previous extension, they will see that you have published an update and can install the latest version. Name (display name of your extension), Author (your personal or company name), and Description are self explanatory… The other fields, we’ll skip for our template.

I’m also skipping the License tab completely, because I don’t provide a EULA for templates. They are only needed for other types of extensions.

The VS Support tab allows you to say where this extension is allowed to install. For framework version, we’re saying that our template should be used with .NET runtime 4.0. Then, the VS Editions can target a version (10.0 in our case) and a set of SKUs. Select a SKU from the dropdown list and click the Add button. As you can see from the figure above, this template is allowed in VS Pro, all of the VSTS SKUs, and in C# Express. Note: The only valid extensions for Express SKUs are templates.

The Images tab allows you to point at the icon and preview files that we packaged into this VSIX file. Currently you need to type the names into the textboxes to match the items in the VSIX file, the Browse buttons aren’t connected (as I said earlier, the VSIXExplorer is a work in progress).

Unfortunately, for templates we duplicate these images in the VSIX file and in the template file. Other extension types don’t already have their own images embedded, so this is only a problem with templates.

And, the References tab is unnecessary for this example.

The one remaining step is to link the template content into the manifest. For this, you need to edit the XML by hand. Just click on the XML tab at the bottom-center of the VSIXExplorer window. You can see that all of the data we changed in the tool has been reflected here. To add the template content, just place the following in the XML:

<Content>

                <ItemTemplate>Item</ItemTemplate>

</Content>

In this snippet, <ItemTemplate> is the type of extension that we’re creating (substitute this with <ProjectTemplate> for project templates; otherwise the rest is applicable to both types). And, Item is the folder name within our VSIX.

You can then switch back to the Design mode, and look in the Contents tab:

This shows you what we just edited. At this point this tab is read-only, but Gearard is working on making this editable, so that there will be no need to drop into XML view to do this final step. He tells me an update for this will be ready “any day now.”

The final step is to be sure to click the Apply Changes button in the lower right corner of the window. This saves the changes to the extension.vsixmanifest file. This is very important to do, or you changes will not be persisted when you close the VSIXExplorer.

At this point you have a packaged up extension that’s ready to be used.

Step 5 – Testing your Extension

It’s pretty easy to test your extension. Just double-click on the VSIX file you just created. This will launch our installer (only on a machine that has Visual Studio 2010 installed on it). Just click the Install button when the UI pops up and wait for it to complete. The template is now recognized by Visual Studio, so start up an instance of VS with a WPF application.

Launch the Add New Item dialog and note that the WPF AboutBox now appears on your list of installed templates. Launch the Extension Manager and see that the WPF AboutBox (C#) extension is installed. And, you can uninstall it at this point as well.

Wasn’t that fun? J

Our packaged extension is ready to upload to the VS Gallery. I’ll go through the upload process in my next post.

 

Posted Thursday, June 04, 2009 8:58 PM by PedroSilva | 4 Comments

Creating an Item Template Extension (Part 1)

I’ve put together a WPF AboutBox item template and released it on the Visual Studio Gallery. It’s published there so that you can download, install, and use it through the Extension Manager and New Item dialog in Visual Studio 2010 Beta 1. Now, I’m going to go through the process, so that you can see how it’s done, and hopefully entice some of you out there to create your own templates to share with the world.

Step 1 – Creating an Item Template

First thing first, you need to have some code that you want to create into a template… perhaps some code that you use all the time (for me this was an AboutBox for WPF applications). Once you’ve written and test the code (yes, testing it is important, remember everyone is going to put this code into their application J), you are ready to export it as a template.

There’s a well hidden feature in Visual Studio under the File menu, called “Export Template…” This launches a wizard to help you create a template from your current solution.

This page lets you pick from an Item or Project template, and the project to use in your template. Item templates are a single file and any of their dependent files. They get shown in the “Add New Item” dialog. And, you can create multiple instances of them in one project. Project templates wrap up a whole project with all of the contents of the project you select. They get shown in the “New Project” dialog. And, you can add multiple projects into a solution. Note: In Beta 1, we only support putting a single project into the template (through the Export Template Wizard or by hand-editing the .vstemplate file, and upload it to the VS Gallery).

After selecting Item Template and the project (WpfAboutBox), click the Next button.

Select the file that you wish to export. The wizard wraps up the file and its dependents. So, this example, you select the AboutBox.xaml file, and it also includes the code-behind file, AboutBox.xaml.cs. You can only select one file to export for an item template.

Click Next to proceed.

Now the wizard asks for the references your template will need. The items you select here will become references in the project where you use the template. Be sure to only select the references that are needed only for the file that you are exporting… or you will create unnecessary references in the target project.

 Once you have selected all of the references you need, click Next.

Fill in the metadata about your template. You have the opportunity to name the template and provide a short description that will be shown in the New Item/Project dialog. As well as an icon and a preview image for the template… while these are optional, I recommend providing them otherwise you get defaults in the New Item/Project dialog, and that won’t look like a finished extension.

Once you’ve filled in all of the data, click the Finish button.

There you are! You now have an item template in your “My Documents” folder under “Visual Studio 10\My Exported Templates”. You can even run the Add New Item dialog in Visual Studio and this template will show up for C# code.

Note: Item templates are a little more complicated than project templates. For a project template, wizard steps 2 & 3 above are skipped, and you go straight to the metadata collection page.

More Info: If you’d like more detailed information about how to create item and project templates, please read: Creating Project and Item Templates.

Step 2 – A Little Template Cleanup

Ideally, we’d be done with our item template. But, there were a couple of little complications that required editing the template file by hand. Luckily the template is just a zip file, so you can look into its contents, and edit the MyTemplate.vstemplate file. This file is an XML file that describes the makeup of your template. If you edit the file in VS, you get intellisense from its schema. So, I made three small but important changes to the file:

  <TemplateData>

    <DefaultName>WpfAboutBox.xaml</DefaultName>

    <Name>WPF AboutBox</Name>

    <Description>Creates an AboutBox for a WPF application</Description>

    <ProjectType>CSharp</ProjectType>

    <SortOrder>10</SortOrder>

    <Icon>__TemplateIcon.ico</Icon>

    <TemplateGroupID>WPF</TemplateGroupID>

  </TemplateData>

 

a)      Changed the Name of the template to include a space… This is the display name in the New Item dialog and looks better with a space. Unfortunately, the name you input for you template is used both for the DefaultName and the Name in the .vstemplate file, so you can’t use different ones for each without editing the file by hand.

b)      Added the <TemplateGroupID>WPF</TemplateGroupID> line to the TemplateData section. This isn’t obvious why, but there’s an issue in the filtering of templates in the New Item dialog when it’s looking online. If the template group is not defined, then you template might not show up correctly, especially for areas that filter, like WPF… trust me, you should do this. I spent quite a few hours tracking down what was going on here.

c)       Added the AboutLogo.png file as payload to be unfolded with the template. First, I added that image file to the .zip file contents. Then, put in the following XML segment with the other ProjectItem defintions:
<ProjectItem SubType="Image" TargetFileName="AboutLogo.png" ReplaceParameters="false">AboutLogo.png</ProjectItem>

This ensures that the image file will be copied into the target project, and that it will not be renamed, and no token replacement will be attempted for this file (it’s an image file, no need for token replacement).

More Info: If you’d like to read more about the format of the .vstemplate file, read this topic.

There you have it… an item template that is now ready to be shared with the world. In my next post, I’ll go through the steps of packaging this template up as an extension that can be uploaded to the VS Gallery and installed through the Extension Manager.

 

Posted Wednesday, June 03, 2009 4:42 PM by PedroSilva | 4 Comments

Quick Tutorial on Building Extensions with the VS SDK

It's pretty cool when you General Manager is out working with the bits you just released. Jason just released a quick tutorial on how to create an editor extension using the VS SDK. Check out the steps he went through to create, build, test, and deploy a simple editor extension.

With these tools in place, we're hoping to see all sort of interesting extensions to VS that even we've never thought of. :)

Posted Tuesday, June 02, 2009 3:59 PM by PedroSilva | 1 Comments

More Posts Next page »
Page view tracker