Visual Studio

MSDN Subscribers: Activate Your VS 2010 Trial With Conversion Key

MSDN has added a trial activation key for subscribers with access to VS 2010 bits.  Log into your MSDN account, go to downloads, find your edition of VS 2010 and look for the key!

image 

This saved me waiting a few hours to download the full version which would automatically update the key.  Enjoy!

WCF Test Client in VS 2010

The other day I fired up a WCF service for the “Take Control of Messages” post and to my surprise a test client opened up which felt very similar to SoapUI.

Loading & Adding the service reference (happens auto-magically)

image

Double-clicking on a service operation brings up the test form.

image 

Fill out the data elements and press invoke to test the service.

image

The client was also able to support when I transitioned to a message contract. 

image

After selecting the type, you can then expand the element to view it’s members.

image

This is a great addition to VS and will greatly help testing services!

Visual Studio 2010 – Xml Schema Designer & Visualization

While preparing for a presentation on Xml support in Visual Studio and Visual Basic I discovered the new Xml Schema Designer in VS 2010 Beta 2.  The Xml Schema Designer lets you visualize your Xml Schema in a very interesting way that helps you see the structure and content defined by the schema set you are working with.  Let’s explore it a little.

For this article I am using the Linq to NIEM sample I showcased at the NIEM NTE in October.  I have converted the solution to VS 2010 Beta 2 and you can read more about that in this post.

After opening the LEXS 3.1 Schema, the following designer window is what you are greeted with:

image

This window allows you to bring items from your schema set into the schema designer.  The designer reflected over the solution and located all the schema sets which you can see in the details list – 20 Schema documents, 820 Global Elements,  10 Global Attributes, 269 Complex Types, 57 Global Simple Types, 0 Global Model Groups, and 1 Global Attribute Group.

Clicking “add” on Global elements yields a scrollable view of all 820 Global Elements.

image

This is a little hard to work with and fortunately the VS team included some alternate views.  My favorite is the content model view:

image

image

In content model view the elements you’ve added display on the left in the workspace.  On the right is a scrollable region with all the elements and their children displayed individually.  You can drill down further by selecting an element in the workspace and view only that element and it’s child nodes.

image

You can click on the image or image to expand or contract the child nodes allowing you to drill down all the way to the simple types.

If all that visualization wasn’t enough – how about we generate a sample?  Right-click on an Xml node in the designer and make it so!

image

The sample contains data in every element and attribute, probably a bit of over-kill but gives you a nice view of what an instance document will look like.

image

Enjoy!

Visual Studio 2010 Project Conversion, Xml Intellisense Improvements, and a Few Other Tips

A few days ago the VS 2010 Beta 2 was announced and I snagged it from MSDN  (MSDN is also sporting a new look and feel which is a  nice change!).  This evening I finally got around to installing it on my laptop.  For Beta 1 I had installed it to my alternate boot-to-VHD copy of Windows 7 Ultimate.  But I was feeling risky tonight and installed it on my main copy of Windows 7 Ultimate. 
The full install weighed in at 6.4gb and included all the bits needed to start developing in Microsoft’s next evolution of Visual Studio. 

To get started with VS 2010 I decided to take a copy of the Linq2NIEM project and convert it to 2010 to test out Xml Intellisense, MS Test Changes for VS unit testing as well as the VB Linq to Xml queries which I have grown very fond of in my previous work with NIEM Xml.

I hit a few snags during the conversion process:

  • The copy of the project still included source binding files – those were removed by the conversion wizard.
  • The Linq2Niem class library and Linq2NiemTests projects did not convert successfully with the solution.  I had to manually convert each project.
  • Post conversion there were target framework errors pointed out by the Test project.  I changed the target framework on the Linq2Niem class library but discovered that you cannot change the target framework on a Unit Test project.  This was a little disappointing, but I was able to just create a new project and import my existing test class file and it worked like a charm.

Other things I noticed:

  • VS 2010 picked up my existing Vibrant Ink theme from my VS 2008 install.  This was great because I would have hated to have to go manually pick all those colors :)
  • Overall performance is improved from Beta 1, or so it seems.  Intellisense seems more responsive and the Xml Intellisense seems much faster than in VS 2008.
  • VB Linq to Xml Intellisense does not provide hints for Abstract element substitutions.  The NIEM nc:DateRepresentation is a good example.  nc:DateRepresentation can be substituted as nc:Date or nc:DateTime, but neither of those shows up as a choice.  This is how things were in VS 2008 so it seems like a connect bug report/suggestion is called for here.  You can work around it but you have to fight intellisense to get it to do what you need it to.
    vs2010_xml_intellisense_bad1 
    Figure 1: At this node the actual element should be nc:ActivityDate – but it’s not displayed
    vs2010_xml_intellisense_bad2 
    Figure 2: You can see in the query above – nc:DateTime is the appropriate element, however, only the abstract date representation is shown.
    vs2010_xml_intellisense_good1 vs2010_xml_intellisense_good2
    Figures 3 & 4 show how the Xml editor properly provides hints for the substitutable elements.  Looks like the issue is really in the VB Linq to Xml parser.

Lastly, how about some gratuitous Windows 7 + VS 2008 “Vibrant Ink” porn?  Looking good!

pc porn