The problem going from Silverlight 2 beta 1 to Silverlight 2 beta 2
by Don Burnett
I keep hearing of people doing scary things with Silverlight version 2 betas like deploying beta 1 application, then installing beta 2 and expecting it not to break.. Well most people who do have "broken" applications can rest assured there's probably not all that much to do to make your beta 1 application function on beta 2. Sometimes it's as simple as changing the javascript for Silverlight detection on your web page..
Let's take a look at the code snippet here and can anyone tell me what's wrong..
<script type="text/javascript">
function onSilverlightError(sender, args) {
if (args.errorType == "InitializeError") {
var errorDiv = document.getElementById("errorLocation");
if (errorDiv != null)
errorDiv.innerHTML = args.errorType + "- " + args.errorMessage;
}
}
</script>
....
<div id="silverlightControlHost">
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="100%" height="100%">
<param name="source" value="ClientBin/WPFBootCamp.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
Maybe it's this "type=" information in the object tag that target beta 1??? Could that be the only problem? Try it out for yourself and see what happens.. Better yet, change the b1 to b2 and see what happens..
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%">How would you fix this? Most people don't use the OBJECT tag anyway and just update their silverlight.js file for beta 2..
Check out the following blogs, for information on real breaking changes..
http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx
http://blogs.msdn.com/silverlight_sdk/archive/2008/06/04/what-s-new-in-silverlight-2-beta-2.aspx
and of course the big list @ MSDN HERE...
http://msdn.microsoft.com/en-us/library/cc645049(VS.95).aspx

