In a previous post I wanted to call attention to the multi-targeting and design surface improvements for Silverlight developers with Visual Studio 2010 Beta 1. There has been some comments on that post and a few emails and Twitter replies as well with some great follow-up questions. I thought I’d post a sort of what works with what information to help you navigate Betaville as a Silverlight developer.
NOTE: We’re talking about Beta technologies here. That means things may not work, that you shouldn’t count on them for production releases at this time, etc. In the ‘release early, release often’ mantra of things, I know Microsoft may not follow the ‘often’ side of things, but we sure do release early a lot of things. It is important to have a perspective that this is for mutual benefit, but also remember that it is beta and things may just not work in harmony.
Being an early adopter usually means you are on the edge. Standing on that edge of technology comes pain with betas at times. Add to that multiple beta technologies and you may feel like you are pulling your hair out constantly. Me too. Here’s the spectrum of things for a Silverlight developer from a current (as of May 2009) perspective.
Silverlight 2 Development
Silverlight 2 has been released for a while now (since Oct 2008) and is production-ready for you to use. There is full tool support in both Visual Studio 2008 SP1 (just install the Silverlight tools for VS2008) and Blend 2 SP1. Both VS2008 and Blend 2 can share project files in harmony and edit back and forth.
The recent Visual Studio 2010 Beta 1 (referred to in this post VS10 so I don’t have to keep typing out beta) will also support Silverlight 2 development. The Silverlight tools will not install on top of VS10 and you’ll get a warning if you try. If all you want is Silverlight 2 development in VS10 right now, install the Silverlight 2 SDK and the Silverlight 2 developer runtime. That’s it…you can then develop Silverlight 2 applications.
Silverlight 3 Development
Silverlight 3 is currently in beta as are the associated tools (Silverlight 3 tools for VS2008 and Blend 3). A lot of people have been working fine with these in beta and everything works well. VS2008 can author SL3 projects and Blend 3 can open them no problem. Both of these are still in beta right now, but it is important to know that Silverlight 3 release tools will be VS2008 and Blend 3.
For VS10 and Silverlight 3, the situation with the tools is similar to Silverlight 2. The Silverlight tools installer will still not run on VS10. If you want to add Silverlight 3 development to your VS10 environment, you can follow my previous post instructions, which basically is to install the SL3 SDK and SL3 developer runtime. At this time, VS10 will only target Silverlight 3 beta and will also not run the .NET RIA Services bits that you might be using.
What about Blend and Visual Studio 2010 Beta 1?
With VS10 there are some caveats. With VS10 you can create multi-target solutions. You can see this when you create a new project in VS10:
Now for the caveat. If you select .NET Framework 4 in VS10, and then open your project in Blend 2 you will see this warning:
In my experience under simple circumstances you can still open it and work with files. Here’s where beta life starts getting confusing. If your Silverlight application is just the application, you will see the above warnings and should be able to edit (regardless of if your target in the new project window was .NET Framework 4 or 3.5). Now, if you also added a web project to your solution and open it in Blend 3 Preview, you will see this:
Indicating that the web project type is not supported at this time in Blend 3. The solution will open in blend (if you say yes) but your web project will have a “?” next to it and read (unsupported project). You’ll still be able to edit the Silverlight application, but not do anything with the web project.
What about WPF projects then?!
If your target selection was .NET Framework 3.5 then you’ll still get the first warning, but should be able to work with the project. If your target selection was .NET Framework 4, then you’ll get the unsupported warning and won’t be able to work with this. Oddly enough, Blend 2 will open the .NET 4 project, weird. In either route, when you compile in blend you’ll see this note:
1: Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild.
2: Treating the project as if it had ToolsVersion="3.5".
That should tell you something if you think Blend 2 is going to build your .NET 4 project just because it will open :-).
Why is it this way and when will it all work?
Ah, the magic crystal ball. If we could get all the teams on the same ship cycle it would be easy, but it just isn’t that way right now. Basically VS10 went into beta 1 lockdown before certain things for Silverlight and Blend tools were able to hit certain milestones. So given that, here’s where we stand.
NOTE: Expression Encoder outputs either Silverlight 1.0 or Silverlight 2 templates and the output are completed projects. If you open up the source for an Encoder project it will prompt the VS10 upgrade wizard, or in VS2008 just open for you to edit (assuming you have the Silverlight tools installed)
For Blend 3 and VS10 projects to work in harmony, an update to the Expression Blend 3 preview that supports Visual Studio 2010 and .NET Framework 4 projects is expected to be available in Q3 of 2009.
For VS10 and Silverlight 3 RTW/.NET RIA Services working, we’re looking at an update to VS10 would be needed and we haven’t determined a timeframe on that just yet.
What should I do?
Well, as a Silverlight developer, I’ve given my opinion already. Until that update for VS10 happens to enable Silverlight 3 RTW and .NET RIA Services development, I think the best option will still be the released tools for the environment (VS2008, Blend 3). Consider VS10 something to look at, but not ready just yet for full Silverlight 3 development.
For other project types like ASP.NET, WPF, WinForms, etc. you’ll still be able to multi-target in VS10 and most of these are released right now so you should be in a decent environment. WPF caveats above still apply as most WPF developers also rely on Blend as a tool for their projects.
I know this is totally confusing and it sucks. After re-reading this, my own head spins. It is easy for us to say it is the pain of an early adopter…and it is. By sitting on the edge with beta technologies we take risks and have to determine our own rewards. Knowing this information should help you be informed about your projects.
- Silverlight 2 + VS2008 + Blend 2 development: released, available, working
- Silverlight 2 + VS10 + Blend 2 development: available, working (VS10 in beta)
- Silverlight 3 + VS2008 + Blend 3 development: available, working (Silverlight 3 and Blend 3 in beta)
- Silverlight 3 + VS10 + Blend 3 development: available, working with caveats (Silverlight 3 beta only, no RIA services)
- WPF + VS10 + Blend 3 development: available, caveat of Blend 3 will not open .NET 4 projects from VS10
Remember, virtual machines can be your friend! For some more general Visual Studio 2010 and .NET 4 training information check out the training kit here. For information regarding ASP.NET MVC and VS10, check out Phil’s post. Hope this helps!