Question

Can I add new Silverlight 2.0 projects to my ASP.NET 2.0 web app and still target .NET Framework 2.0 in Visual Studio 2008?

ScottGu doesn't mention Silverlight in his post on multi-targeting.

Michael Scwartz's posts on Silverlight with Visual Studio .NET 2005 and How to create Silverlight Applications with Notepad refer to VS2005 or to Silverlight 1.1 (i.e. pre-RTM).

Has anyone else tried this yet?

[UPDATE]

Now that I've upgraded the web project I started using the Silverlight control...

Was it helpful?

Solution

Michael is right about using the object tag, but you'll also want to do two other things:

  • Use a Post-Build step in the Silverlight project to copy the built xap file to your web project (as Silverlight links don't work with ASP.NET 2.0 projects).
  • Add the Siverlight.js file to the object tag'd page to get better in-place installation and plugin detection.

OTHER TIPS

The targeting is a per project, there is no reason why you can't include multiple projects that target different frameworks in the same solution.

Yes you can. Because Silverlight runs only on the client, you can invoke the Silverlight plug-in with an object tag:

<object width="300" height="300"
    data="data:application/x-silverlight," 
    type="application/x-silverlight-2" >
    <param name="source" value="SilverlightApplication1.xap"/>
</object>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top