| Comments

I’ve been working on some stuff around templates lately and had my own opinions of some of the value of certain features of the Visual Studio template functionality.  What I’m speaking of here is when you choose File…New Project or on an existing project Add Item.  Both of those show you a list of templates.  When you select one most typically you get new files in your project.  It is one area of Visual Studio that is the simplest to extend and provide specific templates for your developers.

There is an option for template developers to specify what, if any, files are open by default once the template is added.  Using Silverlight as an example, when you create a new project you’ll see that the default MainPage.xaml file is opened for you in the designer.  I wanted to get a feeling of what developers thought of this functionality.  Help me with some research?

This is, of course, totally un-scientific and I just wanted to get a litmus test of what people thought of that functionality (opening files by default, not just the concept of templates). Thanks in advance for helping out!

| Comments

Yesterday Microsoft announced that Visual Studio 2010 Release Candidate was available for MSDN subscribers and would be generally available on 10 February 2010 for the public.  This release represents a significant improvement in the overall Visual Studio product and a lot was based on beta tester feedback.

Of course, as a Silverlight developer you will be wondering: Can I still develop Silverlight 4 applications with the VS2010 RC?

Here’s the simplest form of a FAQ I could provide for you:

Q: What was released this week for Visual Studio 2010?
A: The Visual Studio team released Visual Studio 2010 and .NET Framework 4 Release Candidate builds.

Q: When can I download them?
A: If you are an MSDN subscriber, you can today (8 FEB).  Generally availability will be 10 FEB.

Q: Can I developer Silverlight applications?
A: Yes, you can develop Silverlight 3 applications with the release candidate of Visual Studio 2010.

Q: What about Silverlight 4 applications?
Q: Is there an updated Silverlight 4 Tools installer?
Q: Is there an updated
WCF RIA Services build for VS2010?
Q: Is there an updated
Silverlight Toolkit build for VS2010/Silverlight 4?
Q: Is there an updated Blend for .NET 4 Preview build?

A: At this time, VS2010 RC does not support developing Silverlight 4 applications.  This means that at this time there is no update for Silverlight 4 runtime/tools or the WCF RIA Services or other companion frameworks (toolkit controls, etc.).  This will not be enabled until the next public build of Silverlight 4 and companion frameworks.

Q: If I want to develop Silverlight 4 applications, what should I do?
A: You should stick on the public Beta 2 build of Visual Studio for now with the companion tools/framework builds.

Q: You mentioned ‘next public build’ so when will that be for Silverlight 4?
A: We haven’t released a timeframe on that availability right now. :-(

Q: Can I run Visual Studio 2010 Beta 2 and Visual Studio RC side-by-side?
A: No.

Q: Are there hacks to make Silverlight 4 tools work with the VS2010 RC? 
A: I’m sure someone might cobble something together, but frankly there are issues between the two and the combination isn’t supported.

Q: What is wrong with you people?  Why don’t you release things at the same time?!
A: If everyone could intern for a week in the developer division at Microsoft you’d see the challenges faced with various products innovating on different time schedules and resources and teams managing as best they can.  Frankly, Visual Studio is on a path.  Silverlight 4 as a not-yet-released-product has to wait for VS milestones to ensure SL tools work well with our builds.  This same holds true for the companion frameworks and Blend.  It is not a fun place to be as we are all moving targets for each other with varying dependencies.  The Silverlight and RIA Services teams are working hard to finish a product.  That is our goal.  We want to make sure not to distract resources from adding support to interim builds that we simply can’t handle right now in order to deliver a quality FINAL product for you.

Hopefully this helps, even if it isn’t what you wanted to hear for Silverlight development at this time.


| Comments

If you’ve been working with Visual Studio 2008, Expression Blend 3 and Silverlight (or WPF) development, you’ve likely used the Open in Expression Blend feature in Visual Studio.  This occurs when you right-click on a XAML file in your project/solution and you’ll see that option as long as you have Expression Blend 3 installed.

Well…if you are an eager developer and have installed VS2010 and the Blend Preview for .NET 4, you may have noticed that integration broken.

Problem 1: VS2010 and Blend Preview for .NET 4 on a clean box – NO LINK

You’ve just fired up a new virtual PC or you have a clean install and you’ve installed Visual Studio 2010, the Silverlight 4 tools and Blend Preview for .NET 4.  You start your new XAML development project, add some code, then want to use Blend.  You right-click and see this:

Missing Open in Blend option

Nothing.  No option.  You miss that convenience of immediately opening the solution/file from VS to Blend and want it back.  You are confused because you have both installed!

Problem 2: VS2010 shows me the link, but it opens in Expression Blend 3

The other problem you may face is that you have VS2010, Blend 3 and Blend Preview for .NET 4 installed.  You see the Open in Expression Blend option, but when you click on it expecting it to open the latest Blend, it opens your VS2010 project in Blend 3 (or tries to) and fails.  You want to change this to open in Blend Preview for .NET 4.

Solution

I have a solution for you and luckily it is a fairly easy one. 

First, a warning that “here be dragons” – this is a registry editing procedure.  If you aren’t familiar with editing your registry, or don’t know what it is (highly unlikely), then you shouldn’t be doing this.  Screwing up your registry can cause irreparable damage and may harm small kittens in the process.  Seriously, you’ve been warned so don’t email me if your machine explodes into a pile of dust.  Hey, it works on my machine.

With the warning aside, here’s the fix.  Basically Visual Studio looks for a specific key in the HKLM (that’s HKEY_LOCAL_MACHINE to you registry noobs) for where to launch Expression Blend.  There is only one setting though, so this will apply for any VS instance you have installed.  Once you implement the registry setting you’ll see the option:

Open in Blend from Visual Studio

It is located in HKLM\Software\Microsoft\Expression\Blend – there is a key that VS is looking for there named “VS” with one String value named “BlendLaunchPath” which has the full path to the version of Expression Blend you want to launch.

   1: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\VS]
   2: "BlendLaunchPath"="\"c:\\Program Files\\Microsoft Expression\\Blend Preview for .NET 4\\Blend.exe\""

So if you are missing the link or want to change the link that exists (because you are running Blend 3 and Blend Preview for .NET 4 side-by-side – which can be done if you didn’t know that) all you have to do is change that path.

Works on my machine logoI’m providing a ZIP file of the registry file you can merge (a .REG file) for both 32-bit or 64-bit (x64 is in the Wow6432Node) that will automatically add this setting for you assuming you have Blend Preview for .NET 4 installed in the default location.  You can get that ZIP file here: OpenInBlendRegHack.zip.

Hopefully this is a helpful little tip for you if you want to implement this integration between the beta of VS and the preview of Blend.  I use this integration a lot and it’s nice to have it working with the new tools and not miss anything.  REMINDER: Changing this registry change makes it changed for both VS2010 and VS2008...be warned.  Hope this helps!


This work is licensed under a Creative Commons Attribution By license.

| Comments

Last week, the Silverlight 4 beta release included the Silverlight 4 Tools for Visual Studio 2010.  This single installer would perform the following (assuming you had either Visual Studio 2010 or Visual Web Developer Express 2010 already installed:

  • Install a Visual Studio 2010 service pack (KB976272)
  • Install Silverlight 4 Windows developer runtime (4.0.1108.0)
  • Install Silverlight 4 SDK
  • Install WCF RIA Services (November 2009)

That is all you really needed.  But some may have had an experience afterwards of launching VS2010 and *NOT* seeing the WCF RIA Services Class Library or Silverlight Business Application templates:

WCF RIA Services Templates in VS2010

What is happening here is that likely you already had a version of .NET RIA Services (likely the July 2009 CTP) installed.  The Silverlight tools installer silently failed and just kept going.

If you don’t see the WCF RIA Services Templates…

If you don’t see the WCF RIA Services templates, make sure Visual Studio 2010 and Visual Studio 2008 are both shutdown and perform the following:

  • Go to the Add/Remove Programs control panel application and locate .NET RIA Services.  Select the item and uninstall it.  This will remove the previous July CTP of the artist formerly known as .NET RIA Services.
  • Re-run the Silverlight Tools for Visual Studio 2010 installer. This will re-install the items and ensure that RIA Services is properly installed
    • Optionally you can extract the RIAServices.msi installer by running the tools installer with the /x:<folder> switch which will extract the contents.

After performing the above, you should now see the WCF RIA Services templates and should be working fine.

So, what happened?  Why no fail log?!

We did say beta right? :-) -- In all seriousness, we wanted to ensure that the WCF RIA Services bits got in the tools installer and knew this little inconvenience might creep up for some.  Apologies for the inconvenience.  There also exists no logging of the failure to indicate that there was anything wrong and to assist you in knowing the situation.

This is being fixed in a future installer to detect a previous install of RIA Services and alert the user (or we may even force uninstall it…not sure yet). 

But wait, RIA Services isn’t working in my Visual Studio 2008 environment now!

That’s right.  If you install RIA Services for Silverlight 4/Visual Studio 2010, it isn’t going to work in your Visual Studio 2008 environment.  If you want to work on RIA Services with Silverlight 3 and Visual Studio 2008, then you need to stick with the WCF RIA Services for VS2008 version.

Bottom line: RIA Services does not install side-by-side.

All of this information is provided to you on the WCF RIA Services web site.  The first section explains the bits you need for each environment.

Hopefully this helps clear some confusion.  Yes, I know it is frustrating not getting an error and not seeing things work.  We’re working to solve that (doesn’t help you now, I know) in future setups and make sure the release tools installer does the right thing.  It’s during these beta periods we can help identify such issues to make sure we fix them before release.

If you have questions on WCF RIA Services, be sure to head to the forums where the team is listening!

Hope this helps!

| Comments

Previously I made note of things about the release of Visual Studio 2010 beta 2 with regard to Silverlight development.  I’ve gotten a few questions about if people should start using it for Silverlight development.  Perhaps I can help provide you with the best information I can to make that decision…so here it goes.

Go-live support

Visual Studio 2010 and .NET Framework 4 both have “go-live” support as indicated in the license terms (which are available on the VS2010 download).  If you have never bothered yourself with previous go-live products at Microsoft you may not understand what that means.

In short, “go-live” means we grant permission for you to use the product (in this case tools and framework) in a production environment.  It also means that it is a supported product at that point as well.  For Visual Studio, if you plan on using Visual Studio 2010 for go-live use, email [email protected] so you will be sure to get access to that support.  You should also read the go-live license terms clearly and back-up your project data before upgrading.  More information about go-live support can be found at Jeff Beehler’s blog post.

As with any software, pre-release or not, you should be aware of caveats and gotchas.  I’ve found a few that you should be a ware of and am listing them below.

Installer errors if you have Silverlight RTW (40624) on your machine

If you are a developer and have already downloaded Silverlight 3 when it released, you probably have installed the Silverlight Tools for Visual Studio 2008 already.  Now, if you never updated your tools to the later GDR (service packs) release, then you will encounter an error when installing VS2010 beta 2.  This is because the most recent Silverlight 3 release (3.040818) SDK does not install on top of the initial release (3.040624) SDK.  We know this and this should be remedied by VS2010 official release.

In the short-term, you need to perform a manual step to accommodate.  You can do one of two things:

  • Upgrade your Silverlight Tools for Visual Studio 2008 to the latest SDK and developer runtime.
  • Uninstall the Silverlight 3 SDK and developer runtime.

The second is probably the easiest if you’ve already downloaded the Visual Studio 2010 beta 2 bits.  Simply go to the Add/Remove Control Panel applet in Windows and remove the listings of Microsoft Silverlight 3 and Microsoft Silverlight 3 SDK.  Then run the Visual Studio 2010 beta 2 installer.

What about Expression Blend?

Here is one thing that will be a gotcha.  If you choose the Edit in Expression Blend action while in VS2010, and have Blend 3 installed, you will see that Blend will start but with this message:

Blend Warning 1

Despite what the message says, when you decide to go ahead and open the unsupported project file you will be greeted with:

Blend Warning 2

So there would be your first major caveat.  Your VS2010 project files wouldn’t be able to be opened by Expression Blend 3.  Now, I say this with caution because I’ve had some BASIC projects that have, and others that have not.  Essentially it isn’t ‘supported’ but this will be one of those areas where your mileage may vary.  This may cause you some slight discomfort when needing to tweak visual states or animations, among other things you may use Blend for (resource design, etc.).

Can it co-exist with Visual Studio 2008?

Yes, Visual Studio 2010 beta 2 can be installed side-by-side with Visual Studio 2008 SP1.  This is how I’m running it now and they isolate well.

What about my VS2008 Silverlight project files?

If you open an existing VS2008 Silverlight project/solution, VS2010 will prompt you to upgrade the project file.  Note that when you do so, VS2008 can no longer access that project file.  So this means that you can’t have VS2008 and VS2010 working on the same project/solution files for your Silverlight projects.

This can be a bit of a snag in larger team developments where you have eager developers to want to get started on VS2010, but some still using VS2008 on the same project.  Take caution here.  You can try some of the same methods used in VS2005/2008 days in creating separate project/solution files for the products, but it’s a risky move if the project properties aren’t right.

So what about Silverlight 2 development?

You mean Sivlerlight ‘classic’? :-)  Visual Studio 2010 does not support Silverlight 2 development.  Yes I know in a previous post I showed multi-targeting with Silverlight 2 and 3.  As it stands now though SL2 will not be a target for VS2010 development.

At this point any Silverlight 2 installed client should have been upgraded to Silverlight 3 if they were enabled for auto-update.  Silverlight 3 provides so many more improvements over Silverlight 2 that you should really encourage moving even existing applications to the latest runtime to take advantage of some features.

So can I use it for Silverlight 3 development then?

Works on my machine logoGiven the above known’s (and in general, the known issues with VS2010 beta 2 which are documented in the readme), yes you can use VS2010 beta 2 for Silverlight 3 development.  As noted in my previous post, .NET RIA Services is not yet supported in VS2010).  Again, the above issues might prevent you in your particular project, but I can say that VS2010 works well with Silverlight 3 development. 

Of course your mileage may vary depending on the types of projects, dependencies, frameworks, etc.  But I can confidently say “works on my machine.” :-)

Hope this helps.