Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Silverlight OOB or WebHosted be built under x64 platform?

I made a test SL5 OOB project and tried to build under x64 platform but I get the warning:

"Assembly generation -- Referenced assembly 'CommonLanguageRuntimeLibrary' targets a different processor".

and an error:

Error 2 Could not load file or assembly 'file:///C:\work\TestSilverlightOOB\TestSilverlightOOB\obj\x64\Debug\TestSilverlightOOB.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.Common.targets 214 9 TestSilverlightOOB

Same for WebHosted with RIA enabled.

like image 469
underflow Avatar asked Feb 23 '18 11:02

underflow


2 Answers

Finally the answer to the questions is no. Silverlight apps cannot be build as x64 apps.

The reason is the references from here

c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v5.0

are x86 and there is no x64 SDK for Silverlight 5

like image 189
underflow Avatar answered Sep 22 '22 00:09

underflow


Since it is running correctly in 32 bit mode, and since I see the error points to a SL library in the 32 bit Program files, while running in 64 bit mode, the most probable cause I see is the conflict between the two platforms.

Please try to get Silverlight from here: https://www.microsoft.com/getsilverlight/Get-Started/Install/Default

Hopefully, if you target x64 processors, if you have the above installed, it will find it automatically.

While doing a short research, I have also found this: https://social.msdn.microsoft.com/Forums/vstudio/en-US/20a742a1-b99c-4638-8590-9a9d6a95fb69/building-silverlight-project-using-msbuildexe?forum=msbuild

While not convenient, the accepted answer might be helpful.

like image 41
Wilhelm Sorban Avatar answered Sep 26 '22 00:09

Wilhelm Sorban