Getting Silverlight 4 Business Application to Run on TFS Build Server

Headline: There is a folder that does not display by default in a Silverlight Business Application project called Generated_Code. That has to be added to the project and checked into the solution in order for your Silverlight application to run on your TFS Build Server.

I was trying to get my Silverlight 4 test application to build on a TFS (Team Foundation Server) environment. I installed Silverlight 4, and WCF RIA Services for Visual Studio 2010 (locally and on the build machine). This gives me access to the Silverlight Business Application template. I created a project from that template and ran into numerous issues. Here were the last ones I encountered to get my TFS build to work.

Yes, there are some other issues that are documented other places such as the fact that you have to run the build as x86 on the server:

image

But even after that I kept getting the message: Views\Login\RegistrationForm.xaml.cs (22): The type or namespace name ‘UserRegistrationContext’ could not be found (are you missing a using directive or an assembly reference?)

and: Views\Login\RegistrationForm.xaml.cs (133): The type or namespace name ‘CreateUserStatus’ could not be found (are you missing a using directive or an assembly reference?)

What am I doing wrong?

After lots of steps I finally discovered there is a folder called Generated_Code in the Silverlight project (not the .Web project). I turned on the “Show all Files” and then selected that entire folder and Included it in the project. After that it looked like this (with yellow plus signs instead of the little blue locks you see below):

image

I checked that in and the build finally worked.

image

I hope this saves someone the almost 2 hours this cost me…


Posted

in

by

Tags:

Comments

One response to “Getting Silverlight 4 Business Application to Run on TFS Build Server”

  1. […] WCF and RIA Services – They don’t mention it explicitly, but I do hope they fix some of the code generation issues and the fact that the generated code is not part of the project, thus if you check your code in by default it will not build on your TFS (Team Foundation Server) build machine! I discuss this at length in my post “Getting Silverlight 4 Business Application to Run on TFS Build Server”. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.