Dev Corner - Brian Dishaw
Posted on Friday March 18, 2011 by Betsy Weber
For this week's Dev Corner post, Jared Wein and Randall Brown interviewed the lead developer of Camtasia Relay, Brian Dishaw. Enjoy!
So it's research time again and I decided I wanted to get better with MVVM and TDD. I have an idea for a simple data mashup application for a Windows Phone 7 that will allow me to scan RSS feeds for mentions of fantasy football players. Easy right?
Since others on the team were starting with the frontend work on phone applications, I decided to start on the back end.
I fired up Visual Studio 2010 and created my Silverlight Class Library Project. I then went to create a Test Project. Well, anybody that's done some Silverlight development knows that the Silverlight class libraries don't mix with normal libraries. This really sucks since it doesn't matter what functionality my unit test project has that's above my Silverlight library! My only other option is to use the Silverlight tests that run in a browser. Well this isn't very convenient for developing a class library. So I decided to see if I could hack a Silverlight Class Library Project to act like a normal Unit Test project that uses MSTest.
I'll spare you the discovery phase. Just picture an eighties montage with me in front of a computer programming to Dancing Queen... Yea, it's not pretty.
So the short of it is I figured it out and the changes were pretty simple once I got it all up and running. It required me creating a new Silverlight Class Library Project and editing the csproj file by hand.
I changed the ProjectTypeGuids element from:
1 <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
to
1 <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
I also needed to add a reference to the MSTest framework.
1 <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework"> 2 <HintPath>$(DevEnvDir)PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath> 3 </Reference>
I then built an extension installer to aid in installing the project template. I used this tutorial to help me since it was something I've never done before.
Anyway, I've uploaded the installer to the Visual Studio Gallery. You can download it here.
Brian Dishaw is a lead developer at TechSmith. He is currently working on Camtasia Relay and has contributed to many other products since joining the company in 2005. Prior to joining TechSmith, he graduated from Michigan State University with a degree from the Lyman Briggs college with a focus in microbiology and computer science.


Comments (2)
hack s4
Posted by ahmed | June 2, 2011 2:11 AM
Posted on June 2, 2011 02:11
I'm trying to use your template (as downloaded from the Visual Studio gallery), but I can't get it to work.
I get the following exception:
Test method MyClassTests.MethodTest threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies.
The reference in the test project seems to point to the correct file (C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Windows.dll).
Any thoughts?
Posted by Marcel Veldhuizen | July 28, 2011 11:12 AM
Posted on July 28, 2011 11:12