Skip to main content

Microsoft Silverlight

Answered Question MSBuild error: The Silverlight 3 SDK is not installedRSS Feed

(0)

diesel7633
diesel7633

Member

Member

0 points

5 Posts

MSBuild error: The Silverlight 3 SDK is not installed

Hi,

I'm having trouble getting our solution to build after adding Silverlight.  Below are the details.  I appreciate any assistance.

Our ASP.NET 3.5 SP1 application is configured to CI build via MSBuild on CruiseControl.NET housed on a x64 Win Server 2003 machine.  We recently added a new Silverlight 3.0 application to our solution and upon the next CI build execution, our builds started failing saying it couldn't find the Silverlight. 

errorMSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

This made perfect sense so I logged onto the server and installed the Silverlight 2 SDK and Silverlight 3 SDK in that order then rebooted the server just to be safe.

 After reboot, I forced the next CI build and now received the following error:

 C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets (101,9): error: The Silverlight 3 SDK is not installed

 

At this point, I'm not entirely sure how to resolve this issue with the little MSBuild experience that I have.  The SDK files are all out on the file system properly at: 

 C:\Program Files (x86)\Microsoft SDKs\Silverlight\v2.0
 C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0

Any ideas on how I should proceed to resolve this?  (My guess is it is confused by it being in Program Files (x86) vs. the standard Program Files path.)

Thanks in advance,
Scott

 

billsm
billsm

Participant

Participant

1371 points

489 Posts

Re: MSBuild error: The Silverlight 3 SDK is not installed

First of all I am not sure I can help you except to ask you this....Did you try running silverlight and visual studio

in 32 bit mode? I have a vista   x86 system which is 32 bit....Visual studio along with silverlight  only

works only  in 32 bit mode which is x86 on your program files . People that own 64 bit systems have to run this in a 32 bit bit operation.....

There should be an option on your computer to run this in a  32 bit mode and I hope this solves your problem. 

I believe the program files you installed should be the correct path    

Please mark this post as answered if I solved your problem....Thank you....   

 

diesel7633
diesel7633

Member

Member

0 points

5 Posts

Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

 Well I don't have Visual Studio installed on my CI Build machine so not sure this applies.  What I did end up trying was downgrading my Silverlight 3.0 application to a 2.0 application since there really wasn't anything specific to 3.0 in my code.

 What I run into now is finds the paths to the targets files and proceeds to reach the CompileXaml task where it fails attempting to load PresentationCore.dll. 

C:\Program Files\MSBuild\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.Common.targets (154,9): errorMSB4018: The "CompileXaml" task failed unexpectedly. System.IO.FileLoadException: Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) File name: 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.Silverlight.Build.Tasks.CompileXaml.LoadSilverlightAssemblies(String[] frameworkPaths) at Microsoft.Silverlight.Build.Tasks.CompileXaml.GenerateCode(ITaskItem item, Boolean isApplication) at Microsoft.Silverlight.Build.Tasks.CompileXaml.Execute() at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) 

I have no idea why it can't find this.  My msbuild args are: /p:Configuration=Debug;Release /v:diag

Furthermore, I do see two versions of this DLL in the GAC for what appears to be a 32 bit and 64 bit version.  Do you have any ideas on how it would get it to resolve this DLL?

billsm
billsm

Participant

Participant

1371 points

489 Posts

Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

If you are going to be using silverlight 3 for any development platform

you need visual studio 2008 and visual studio 2008 sp1 along with silverlight tools 3

http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&displaylang=en

. I am really not sure what you are planning to do....  here is the link

billsm
billsm

Participant

Participant

1371 points

489 Posts

Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

If you are trying to use silverlight 2 it requires visual studio 2008 and visual studio 2008 sp1 if you are going to do any

software enginnering techniques.  http://www.microsoft.com/downloads/details.aspx?FamilyId=c22d6a7b-546f-4407-8ef6-d60c8ee221ed&displaylang=en

you can install vs  web developer and vs web developer sp2

diesel7633
diesel7633

Member

Member

0 points

5 Posts

Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

 Agreed that our team needs Visual Studio with the Silverlight Tools installed to develop Silverlight applications.  The issue in question isn't related to our local development machines.  We have a server dedicated to continuous integration that we are trying to keep from being polluted with development tools that are unnecessary to the build process.  This is similar to a TFS build machine installation.  You wouldn't have Visual Studio installed on that machine.  The only difference is our server is x64 with Cruise Control.NET but its only job is to kick off MSBuild for a .NET 3.5 SP1 solution and has been perfectly successful for almost a year now.  The issue came from adding a silverlight application (that builds and runs perfectly find on our own x86 machines).

 Again, as I stated in a previous reply, I backed out v3.0 SDK to try and see where the issues occurred and with only the v2.0 SDK.  The SDK seems to be recognized as far as paths but now when it runs the MSBuild CompileXaml task, it bombs cause it says it cannot load PresentationCore.dll.  I've verified that the DLLs exist in the GAC.  Actually, there are 2 versions for what looks to be the architecture type (AMD64, x86).  My build is set to build for "Any CPU".

 I appreciate everyone's help and I'm not much for typically posting on forums so if you know of a better place to post my issue, I'll take any recommendations to help get this resolved.

diesel7633
diesel7633

Member

Member

0 points

5 Posts

Answered Question

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

Unfortunately, the net result probably won't help others but I ended up moving my x64 build server to an x86 server and was able to run my MSBuild off of Cruise Control.NET with no issues

jmab
jmab

Member

Member

4 points

2 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

We're in exactly the same situation - Silverlight 3, Cruise Control, MSBuild, 64 bit server.

Seems to work if you run C:\WINDOWS\microsoft.net\Framework\v3.5\MSBuild.exe.

But get the error "The Silverlight 3 SDK is not installed" if you run C:\WINDOWS\microsoft.net\Framework64\v3.5\MSBuild.exe.

cj
cj

Member

Member

4 points

2 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

Same here as well.  Turns out the CI server did not have the silverlight SDK registry settings, so we exported them from one of our development machines and this got rid of the "Silverlight 3 SDK is not installed" message.

We now have: "The "ValidateXaml" task failed unexpectedly ... System.IO.FileLoadException: Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

 Any ideas?

jmab
jmab

Member

Member

4 points

2 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

You get the petrol, I'll get the matches?

diesel7633
diesel7633

Member

Member

0 points

5 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

 Based on my experiences with this issue, I'd have to agree.  Pretty much burned a week of development for me and I just ended up falling back to a 32 bit server cause I had to make some progress somewhere.

 

I was never able to resolve the PresentationCore.dll loading issue.  If I get some time, I'll have to go back and try putting in the different MSBuild.exe and see what happens.

schmidtaa
schmidtaa

Member

Member

2 points

1 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

This seems to be a bug in Silverlight SDK code. The problem here is that the SDK is looking at the wrong place for the assemblies it is trying to use. On Windows 64 bit, it is trying to locate the registry keys at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft, when it should be HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node, because Silverlight SDK is running in 32 bit mode inside the Visual Studio 32 bit. It is related to the fact, that on Windows 64, WoW64 registry redirects are in place (see http://download.microsoft.com/download/3/a/9/3a9ad58f-5634-4cdd-8528-c78754d712e8/28-DW04040_WINHEC2004.ppt)

Workaround for the problem is to create necessary keys under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft key.

Sincerely,

Alexander Schmidt, MCPD EA 

 


Sincerely,
Alexander Schmidt, MCPD EA
http://www.alexschmidt.net/blog

cj
cj

Member

Member

4 points

2 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

Hi Alexander,

 You're right in that creating the necessary keys will get rid of the "Silverlight 3 SDK is not installed".  Like I said above though, is that we then get the PresentationCore.dll issue giving The "CompileXaml" task failed unexpectedly.

 Like Diesel, we've had to stop investigating this and revert to a 32 build but if you can resolve that problem please shout.

andresv
andresv

Member

Member

0 points

1 Posts

Re: Re: Re: MSBuild error: The Silverlight 3 SDK is not installed

I found a simple workaround when using VS2010 Build Agents.

Just set the configuration of the build definition and set the "MSBuild Patform" parameter to "X86" (it was "Auto" before). I think it forces the execution of the x86 version of MSBuild.exe (not confirmed) and therefore the same effect is achieved (than running the build in an x86 machine).

Hope it helps, (and hope the Silverlight Team fixes this nasty bug...)

http://weblogs.asp.net/andresv/archive/2009/11/05/build-silverlight-2-0-or-3-0-projects-with-an-x64-tfs-2010-build-agent.aspx

Best regards,

Andres G Vettori, VMBC, CTO

Andrés G Vettori, VMBC, CTO
email: andresvettori@gmail.com

We are the Administrators. Prepare to be Managed and Audited. Resistance is Futile.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities