Friday, August 15, 2008

How to know which is the current running Visual Studio registry hive.

It’s really useful to know the current registry hive when, for example, when you’re running Visual Studio into the experimental hive even considering, that since Vs 2008 it includes the RANU option (Run as Normal User) with basically means that Visual Studio will loads the information from the HKCU instead of HKLM. You can find more information about that in the Aaron Marten blog.

So, since Vs SDK for Visual Studio 2008 and as a part of MPF we have a VSRegistry helper which tell us in which registry hive the Vs is running, it basically has a static method with a couple of signatures:

image

image

What it does is returns the current running registry key according the type of key, which could be UserSetting, Public Configuration (know as the common registry key, where is located most of the Vs information), etc.

If you’re developing a VSIP package you can also use the ApplicationRegistryRoot property what it basically uses that helper.

Wednesday, April 16, 2008

T4 Editor: coming soon!

Since some time ago, we're working in a new release of the T4 Editor. Maybe one of the most interesting feature is the ability to have intellisense in the contained language. Victor has posted some screenshots that showcases that feature, check it out here.

Here you've a quick snapshot of how it looks ;).

Thursday, October 18, 2007

Visual Studio T4 Editor is finally is out!.

Today we released a new version of the T4 Editor.

You didn't heard about T4 templates or Text Transformations, before?, That's a technology made by P&P and was used by the DSL Tools team to able to run text transformations in its projects. Now the T4 template bits will be available for free as a part of the VS Orcas, so you would be run your own transformations in your projects for free. For example a common case is the artifacts generation from a database.

Some of the features of the new T4 Editor:
 
- Available for Visual Studio 2005 and 2008 (Orcas B2)
- Colorization of directives, text blocks and code.
- Intellisense on directives and attribute values.
- Support for multiples host (GAX, DSLTools and a new Clarius one)
- Preview transformation and properties reflection.

See it in action here!.

You can read more about the features of the editor in my previous post and also in t4editor.net where you'll find useful screenshots and more videos.

Click here to Download the new T4Editor now!

Feel free to send me your feedback about what features should have next versions.

Enjoy!.

Friday, October 5, 2007

Dealing with the UnfoldTemplateAction and parameter replacement.

There are a well known issue with the UnfoldTemplateAction which is provided in the GAX Library. Basically this action able you to unfold .vstemplate files by hand but it has a ugly issue in where you can't do any parameter replacements than the default ones.

In fact is not a bug into the action so the issue resides in that is using the AddFromTemplate method from the DTE automation model and there's no way to pass any replacement dictionary using that method directly.

So I wrote an action in order to have a workaround, basically what it does is create a copy of the vstemplate and its elements, perform all the replacements, then unfold the template through the UnfoldTemplateAction.

You can download the source from here.

Hope that helps!

Tuesday, September 25, 2007

Registering a GAX Guidance Package in a Experimental Vs Hive

One of the features in the latest July 2007 CTP version of GAX/GAT is the possibility to include switches in the installer execution at design time (that's the switches that will be added in the installutil execution when you register a GP through the Register GAT action, as show in the following picture).

 image

So in addition of this feature we've included a new switch that able you to register the package in the Experimental Vs hive or any other one that you're working on just specifying the RegistrationSettings attributes in your guidance package manifest as follow...

image

Note that any switch specified in the registration settings will be added to the installutil command at design time but it won't take effect in your setup project or if you run the installutil by hand. In that case you will have to specify that switches by hand.

Use a simple Form instead of the GAX Wizard

A recipe execution implies three parts which are, the arguments, the data gathering and the actions that will be executed using those arguments. By default the data gathering service in GAX was implemented over the Vs Wizard Framework due to a wizard is a very common scenery to gather values.

Nevertheless that data gathering service could be extended and you can extend it for example, to replace the UI using simple form instead of the default Wizard pages or just calling directly a web service without any UI.

To achieve that, you have to create your own implementation of a gathering service implementing the IValueGatheringService interface. That interface has an Execute method which receives an XmlElement that represents the inner XML chunk contained in the GatheringServiceData element as is showing in the following picture:

image

Note that I specified the ServiceType attribute which has the type of my own IValueGatheringService implementation. Basically what it's doing is getting the type attribute contained in the Form element and then it's trying to instantiate that type to show a simple winform.

image