Posted 22 October 2009 Tweet
Now that Visual Studio 2010 Beta 2 is out, it is a lot of fun to use the fully interactive design surface for Silverlight. However, it comes at a cost: you need to use the conversion wizard to bring your Visual Studio 2008 solutions and projects up to the expected format for the designer tools and new build environment.
If you deliver your source ultimately to a Visual Studio 2008-targeted source project, or have issue adopting a beta product until its release, this is a pain.
I wrote a tool last month for round-trip converting Silverlight-specific solutions and .csproj files between the versions, and want to share it as-is, with no warranty, hoping someone finds it useful.
Here are two potential solutions for dealing with the conversion issue, actually the second builds from the first.
If your project is not churning that often in added and removed files, source control is the easiest solution to this problem!
Easy enough. But not crisp enough!
Now assuming you are already using source control, then you can consider using my script/tool for performing the round-trip conversion. You still want to have everything in source control – you just never know.
ThereAndBackAgain.zip [21.8K, Zip]
I have included the source, Ms-PL licensed, because though awful, maybe someone can do something much better with it!
Move into the root directory of your solution in a command prompt window, and provide the path to the ThereAndBackAgain.exe file. It will recurse the current directory.
c:\tools\ThereAndBackAgain.exe 2010 <enter>
You’ll see a quick list of what is changed. You can run this on a directory tree that is already converted, and it should not be affected.
c:\tools\ThereAndBackAgain.exe 2008 <enter>
This works for me. Uh and so no promises beyond that. I literally just diff’d a new VS 08 and VS 2010 Silverlight project and wrote something to move between the two. Nothing fancy.
If you go this route, remember to convert back your projects and solutions using the tool before checking in! You don’t want to break the build, or a teammates’ development experience.
Hope this helps. Again, I wrote this script specifically to meet my needs, but it is FAR from production-ready. You are on your own, feel free to take and run with this.
Jeff Wilcox is a Principal Software Engineer at Microsoft on the Azure team.
Jeff has been at Microsoft since 2005 and holds a Bachelor of Science from the University of Michigan. Jeff lives in downtown Seattle.