Today while creating my first CI Build definition in the Visual Studio Team Foundation Server, I noticed that, though the Silverlight 5 SDK is installed in the server, I was unable to run the build. It was throwing an error message that says “The Silverlight 4 SDK is not installed”.
The issue was not actually with the Silverlight SDK and I found the solution after lots of analysis. In this post, I am going to share it so that, if you come across the same issue, it will be helpful.
I was actually trying to create a build definition to do automated build on each code check-in named as CI build (Continuous Integration) for one of my Silverlight project. When I triggered the build for the first time, I noticed that the build failed as it was unable to detect Silverlight 4 SDK in the server.
The Team Foundation Server (TFS) was recently upgraded to TFS 2012 from the TFS 2010 version and the Silverlight 5 SDK was installed earlier prior to TFS 2012 upgrade. So, I repaired the installation of Silverlight SDK.
I was in hope that, this time it will work but alas, it did not. I was getting the same issue. We already know that Silverlight 5 SDK comes with Silverlight 4 SDK, right? Then why it is asking me to install the Silverlight 4 version on top of version 5? That was not understandable to me.
The automated build for the Silverlight project was failing in the server with the following message: “C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.Common.Targets (104): The Silverlight 4 SDK is not installed”.
Here is the screenshot of the failed build activity log:
I am not a TFS Administrator, I am just a developer. So, the issue was not known to me. I started querying online technical documents and later came to know that it was not due to Silverlight SDK installation but a small configuration issue in the build definition that I created.
By default, the build definition creates under the “MSBuild Platform” as “Auto” but for the Silverlight projects, it needs to be specified explicitly as “x86” platform, otherwise it will not build.
To resolve this issue, you need to open the build definition (you must be a build administrator), navigate to “Process” tab and set “X86” as the “MSBuild Platform” as shown below:
That’s all. The build will now complete successfully if triggered manually or automatically. If you faced the same issue, just follow the above solution which will work for you. For your reference, I am just pointing the positive solutions in this case:
- First check whether the latest Silverlight SDK is already installed in your server.
- If you installed Team Foundation Server after installing the Silverlight SDK, you have to re-run the SDK installation.
- Edit the build definition and check whether the MSBuild Platform is set to x86 as Silverlight projects needs to be build against the targeted platform version only.
Did it solve the problem that you faced? If so, don’t forget to drop a line below saying how this helped you. This will energized me to write more posts on the same topic. If you know some other trick to resolve the same issue, let me know. I will validate it and add it in this post which will help others if they face similar ones in future.