Running an xap (silverlight app) in VS 2005

silverlightxap

I've written a small silverlight app in vs 2008. Now I'd like to plug that app into a site that was developed using vs.net 2005. what are the steps needed to do this. This is what I've done so far.

In web.config

<compilation debug="true" strict="false" explicit="true">
        <assemblies>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </assemblies>
    </compilation>

<controls>
            <add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls" assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </controls>

In the asp page.

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register TagPrefix="asp" Namespace="System.Web.UI.SilverlightControls" Assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

<body>
<form id="form1" runat="server">
    <div>
        Silverlight Test
        <asp:ScriptManager ID="scriptManager" runat="server" />
        <div style="height: 100%;">
            <asp:Silverlight ID="silverlightControl" runat="server" Source="~/TypingTestV2.xap"
                MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
        </div>
    </div>
</form>

When i run the app, i get an error in IE

Webpage error details :
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.30729; MS-RTC LM 8; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Fri, 7 Aug 2009 13:12:30 UTC
Message: ASP.NET Ajax client-side framework failed to load.
Line: 38
Char: 34
Code: 0
URI: htt://localhost:4063/Silverlight.aspx

Message: 'Sys' is undefined
Line: 48
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspx

Message: 'Sys' is undefined
Line: 57
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspx

Message: 'Sys' is undefined
Line: 67
Char: 1
Code: 0
URI: htt://localhost:4063/Silverlight.aspx

and in Firefox :

ASP.NET Ajax client-side framework failed to load.
[Break on this error] if (typeof(Sys) === 'undefined') throw n…ient-side framework failed to load.');\r\n

So i'm not sure what the problem is. although it says AJAX, I'm not sure what the next step would be

(the htt above was http, but the site won't allow me to do more than one hyperlink in the post, so i changed it to htt)
hope someone is willing to help.
Shannon

Best Answer

Sliverlight 3 has dropped the asp silverlight server control, hence you would be better off duplicating the content of the test .htm page that VS 2008 creates. Use the <object> tag directly in your ASP.NET 2.0 app.

Related Topic