Silverlight Application Compile Failed in Visual Studio 2013

2014-02-20


We had an ASP.NET project using Silverlight and WCF which developed in Visual Studio 2010 and Visual Studio 2012, both versions worked without any problems.

From this year we tried migrate the ASP.NET project to Visual Studio 2013 since there are new features we can use in Visual Studio 2013, however, we could not compile the project, the compile errors came from Silverlight sub project, which all were about the service reference did not include methods, which meant the Silverlight application could not load WCF service, even we removed the web service reference and rebuilt still not worked, also, there were other errors message indicated Silverlight application could not find some libraries.

We spent long time to find out the reason. The reason is that Visual Studio 2013 ONLY supports Silverlight 5, it does not support all previous Silverlight versions. But our Silverlight is just based on Silverlight 4, which includes libraries came from Silverlight 4 toolkit.

image

So what we did was just update our Silverlight toolkit from 4 to 5, but note here: if you download Silverlight 5 toolkit from their official page and installed on computer directly, you will still can not get your Silverlight Application compile ok in Visual Studio 2013, the correct way is using NuGet.

1: Right click on your Silverlight application, select "Management NuGet Packages…"

2: Find Silverlight 5 toolkit, you must make sure you are trying to install Silverlight 5 libraries, not Silverlight 4,  for example, there are 2 Silverlight Toolkit – Core, the first one is Silverlight 4, you should turn several pages and find the second Silverlight Toolkit – Core to install, which is version 5.2011.11 on my current NuGet service.

image 

Also I had to install another NuGet package named Silverlight Toolkit – Input.

After installed above NeGet packages, my ASP.NET project got compile successfully.