none
cannot run Silverlight project of SDK 1.1

    Question

  • Hi All,

    The last time, I always run Ok with many sample of Silverlight in Silverlight SDK 1.1. But in today, when I run again it then browser show icon Silverlight require me have to download Silverlight. In this time, my computer had installed Silverlight Alpha Refresh 1.1, Orcas studio, IE7.

    Please help me solve this problem. Hope that everyone give me an advise or solution.

    Thanks a lot. 

    Thursday, August 02, 2007 10:50 PM

Answers

  • Even i had the same problem before... 

    You just need to replace the old javascript files with the new javascript files which comes along with Microsoft Silverlight 1.1 Software Development Kit Alpha Refresh

    http://www.microsoft.com/silverlight/tools.aspx#6_0

     Remember to make necessary changes in the function createSilverlight() regarding version number and all... here is one example

    function createSilverlight()

    {                                  
       Silverlight.createObjectEx({source: 'Page1.xaml', parentElement:document.getElementById("SilverlightControlHost"), id:'SilverlightControl', properties:{width:'1024', height:'530', background:'white', isWindowless:'false', framerate:'24', enableFramerateCounter:false, version:'1.0'}, events:{onError:null, onLoad:null, onResize:null}, context:null});
       
    }
     

    I hope this answers your question.... Smile

    Friday, August 03, 2007 12:37 AM

All replies

  • Even i had the same problem before... 

    You just need to replace the old javascript files with the new javascript files which comes along with Microsoft Silverlight 1.1 Software Development Kit Alpha Refresh

    http://www.microsoft.com/silverlight/tools.aspx#6_0

     Remember to make necessary changes in the function createSilverlight() regarding version number and all... here is one example

    function createSilverlight()

    {                                  
       Silverlight.createObjectEx({source: 'Page1.xaml', parentElement:document.getElementById("SilverlightControlHost"), id:'SilverlightControl', properties:{width:'1024', height:'530', background:'white', isWindowless:'false', framerate:'24', enableFramerateCounter:false, version:'1.0'}, events:{onError:null, onLoad:null, onResize:null}, context:null});
       
    }
     

    I hope this answers your question.... Smile

    Friday, August 03, 2007 12:37 AM
  •  

    Hello,

    I am also getting the same problem. I modified the function according to your above suggestion.

    When i am debugging my application, it is giving me the following error

    Error 18 'System.Windows.Visibility' does not contain a definition for 'Hidden' and no extension method 'Hidden' accepting a first argument of type 'System.Windows.Visibility' could be found (are you missing a using directive or an assembly reference?) D:\SliverLight\SamplesBuildByOwn\Baby-Blooz\13JulyLatest\Babyblooz\BabyBlue\Page.xaml.cs 67 47 BabyBlue
     

     I couldnt able to run the Silverlight project. Could you please suggest me what else i need to modified. 

     

    Friday, August 03, 2007 9:10 AM
  • Change the line of code that uses the 'Hidden' enumeration to use the 'Collapsed' enumeration instead.

    Remove Visibility.HiddenIn order to reduce surface area, we removed Visibility.Hidden from the product. Prior to this change Visibility.Hidden behaved the same as Visibility.Collapsed. From the functionality stand-point, the Silverlight behavior is closer to the WPF Visibility.Collapsed hence we kept Collapsed. Replace all occurrences of "Hidden" in both XAML and script with "Collapsed".

     

    Friday, August 03, 2007 9:26 AM
  • Thanks buddy,

    Due to change in plugin from 'Silverlight.1.1alpha.exe' to 'Silverlight.1.1.AlphaRefresh.exe'. Still i couldnt able to run my project. Following are the modifications that i did i my project.

    1) I have changed the Silverlight.js file (please find below Silverlight.js file)

    ///////////////////////////////////////////////////////////////////////////////

    //

    // Silverlight.js (1.1 Preview) version 1.0

    //

    // This file is provided by Microsoft as a helper file for websites that

    // incorporate Silverlight Objects. This file is provided under the Silverlight

    // SDK 1.1 license available at http://go.microsoft.com/fwlink/?linkid=94243.

    // You may not use or distribute this file or the code in this file except as

    // expressly permitted under that license.

    //

    // Copyright (c) 2007 Microsoft Corporation. All rights reserved.

    //

    ///////////////////////////////////////////////////////////////////////////////

    if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.ua=null;Silverlight.available=false;Silverlight.fwlinkRoot="http://go.microsoft.com/fwlink/?LinkID=";Silverlight.StatusText="Get Microsoft Silverlight";Silverlight.EmptyText="";Silverlight.detectUserAgent=function(){var a=window.navigator.userAgent;Silverlight.ua={OS:"Unsupported",Browser:"Unsupported"};if(a.indexOf("Windows NT")>=0)Silverlight.ua.OS="Windows";else if(a.indexOf("PPC Mac OS X")>=0)Silverlight.ua.OS="MacPPC";else if(a.indexOf("Intel Mac OS X")>=0)Silverlight.ua.OS="MacIntel";if(Silverlight.ua.OS!="Unsupported")if(a.indexOf("MSIE")>=0){if(navigator.userAgent.indexOf("Win64")==-1)if(parseInt(a.split("MSIE")[1])>=6)Silverlight.ua.Browser="MSIE"}else if(a.indexOf("Firefox")>=0){var b=a.split("Firefox/")[1].split("."),c=parseInt(b[0]);if(c>=2)Silverlight.ua.Browser="Firefox";else{var d=parseInt(b[1]);if(c==1&&d>=5)Silverlight.ua.Browser="Firefox"}}else if(a.indexOf("Safari")>=0)Silverlight.ua.Browser="Safari"};Silverlight.detectUserAgent();Silverlight.isInstalled=function(d){var c=false,a=null;try{var b=null;if(Silverlight.ua.Browser=="MSIE")b=new ActiveXObject("AgControl.AgControl");else if(navigator.plugins["Silverlight Plug-In"]){a=document.createElement("div");document.body.appendChild(a);a.innerHTML='<embed type="application/x-silverlight" />';b=a.childNodes[0]}if(b.IsVersionSupported(d))c=true;b=null;Silverlight.available=true}catch(e){c=false}if(a)document.body.removeChild(a);return c};Silverlight.createObject=function(l,g,m,j,k,i,h){var b={},a=j,c=k;a.source=l;b.parentElement=g;b.id=Silverlight.HtmlAttributeEncode(m);b.width=Silverlight.HtmlAttributeEncode(a.width);b.height=Silverlight.HtmlAttributeEncode(a.height);b.ignoreBrowserVer=Boolean(a.ignoreBrowserVer);b.inplaceInstallPrompt=Boolean(a.inplaceInstallPrompt);var e=a.version.split(".");b.shortVer=e[0]+"."+e[1];b.version=a.version;a.initParams=i;a.windowless=a.isWindowless;a.maxFramerate=a.framerate;for(var d in c)if(c&&d!="onLoad"&&d!="onError"){a=c;c=null}delete a.width;delete a.height;delete a.id;delete a.onLoad;delete a.onError;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;if(Silverlight.isInstalled(b.version)){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var f=Silverlight._silverlightCount++;a.onLoad="__slLoad"+f;a.onError="__slError"+f;window[a.onLoad]=function(a){if(c.onLoad)c.onLoad(document.getElementById(b.id),h,a)};window[a.onError]=function(a,b){if(c.onError)c.onError(a,b);else Silverlight.default_error_handler(a,b)};slPluginHTML=Silverlight.buildHTML(b,a)}else slPluginHTML=Silverlight.buildPromptHTML(b);if(b.parentElement)b.parentElement.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.supportedUserAgent=function(c){var a=Silverlight.ua,b=a.OS=="Unsupported"||a.Browser=="Unsupported"||a.OS=="Windows"&&a.Browser=="Safari"||a.OS.indexOf("Mac")>=0&&a.Browser=="IE";if(c=="1.1")return !(b||a.OS=="MacPPC");else return !b};Silverlight.buildHTML=function(c,d){var a=[],e,i,g,f,h;if(Silverlight.ua.Browser=="Safari"){a.push("<embed ");e="";i=" ";g='="';f='"';h=' type="application/x-silverlight"/>'+"<iframe style='visibility:hidden;height:0;width:0'/>"}else{a.push('<object type="application/x-silverlight"');e=">";i=' <param name="';g='" value="';f='" />';h="</object>"}a.push(' id="'+c.id+'" width="'+c.width+'" height="'+c.height+'" '+e);for(var b in d)if(d)a.push(i+Silverlight.HtmlAttributeEncode(b)+g+Silverlight.HtmlAttributeEncode(d)+f);a.push(h);return a.join("")};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(e){var a=null,g=Silverlight.fwlinkRoot,c=Silverlight.ua.OS,b="92822",d;if(e.shortVer=="1.1")e.inplaceInstallPrompt=false;if(e.inplaceInstallPrompt){var i;if(Silverlight.available){d="94376";i="94382"}else{d="92802";i="94381"}var h="93481",f="93483";if(c=="Windows"){b="92799";h="92803";f="92805"}else if(c=="MacIntel"){b="92808";h="92804";f="92806"}else if(c=="MacPPC"){b="92807";h="92815";f="92816"}a='<table border="0" cellpadding="0" cellspacing="0" width="205px"><tr><td><img title="Get Microsoft Silverlight" onclick="BLOCKED SCRIPTSilverlight.followFWLink({0});" style="border:0; cursor:pointer" src="{1}"/></td></tr><tr><td style="background:#C7C7BD; text-align: center; color: black; font-family: Verdana; font-size: 9px; padding-bottom: 0.05cm; ;padding-top: 0.05cm" >By clicking <b>Get Microsoft Silverlight</b> you accept the <a title="Silverlight License Agreement" href="{2}" target="_top" style="text-decoration: underline; color: #36A6C6"><b>Silverlight license agreement</b></a>.</td></tr><tr><td style="border-left-style: solid; border-right-style: solid; border-width: 2px; border-color:#c7c7bd; background: #817d77; color: #FFFFFF; text-align: center; font-family: Verdana; font-size: 9px">Silverlight updates automatically, <a title="Silverlight Privacy Statement" href="{3}" target="_top" style="text-decoration: underline; color: #36A6C6"><b>learn more</b></a>.</td></tr><tr><td><img src="{4}"/></td></tr></table>';a=a.replace("{2}",g+h);a=a.replace("{3}",g+f);a=a.replace("{4}",g+i)}else{if(e.shortVer=="1.1"){b="92821";if(Silverlight.available)d="94378";else d="92810";if(c=="Windows")b="92809";else if(c=="MacIntel")b="92813"}else{if(Silverlight.available)d="94377";else d="92801";if(c=="Windows")b="92800";else if(c=="MacIntel")b="92812";else if(c=="MacPPC")b="92811"}a='<div style="width: 205px; height: 67px; background-color: #FFFFFF"><img onclick="BLOCKED SCRIPTSilverlight.followFWLink({0});" style="border:0; cursor:pointer" src="{1}" alt="Get Microsoft Silverlight"/></div>'}a=a.replace("{0}",b);a=a.replace("{1}",g+d);return a};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--){window["__slLoad"+a]=null;window["__slError"+a]=null}if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}

    2) I have modified the TestPage.html

    <!-- saved from url=(0014)about:internet -->

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <!-- saved from url=(0014)about:internet -->

    <head>

    <title>Silverlight Project Test Page </title>

     

    <script type="text/javascript" src="Silverlight.js"></script>

     

    <script src="CreateSilverlight.js" type="text/javascript"></script>

    </head>

    <!-- Give the keyboard focus to the Silverlight control by default -->

    <body>

    <form>

    <div style="background-color:Blue" id="SilverlightControlHost" >

    <script type="text/javascript">

    var pe= document.getElementById("SilverlightControlHost");

    createSilverlight();

    </script>

    </div>

    </form>

    </body>

    </html>

    3) I have created CreateSilverlight.js file with below script

    // JScript source code

    function createSilverlight()

    {

    Silverlight.createObject(
    "Page.xaml", pe, "SilverlightControlHost",

    {width:'1024', height:'768',version:'1.1'},

    {onError:null, onLoad:null},null);

     

     

    }

    Still i could nt able to run my silverlight application and getting following error

    ErrorCode:2250

    ErrorType: ParserError

    Message: AG_E_RUNTIME_MANAGED_UNKNOWN_ERROR 

    Could you please suggest me the solution of this problem.

     

    Monday, August 06, 2007 2:16 AM
  • Another common parser error introduced by the new version:

     

    New Parser Error on Invalid Double Values like "Auto" We report a greater number of parser errors. The applications will break in cases where the developer set a numeric property to an invalid value. The previous parser bits treat the invalid value as “0” where as the current parser bits throws an error. The following is an example:

    XAML

    <TextBlock Width="Auto" Text="Created By:" />
    “Auto” is not supported. Previously the above caused the Width to be set to 0. Given that we do not clip TextBlock by Width, this did not impact the application behavior. This, however, will generate a parser error in the current bits.
    Monday, August 06, 2007 8:40 AM
  • Can we port silverlight application on MSN messenger, if yes do you have any idea how we can do it and what are the main API's being used for porting silverlight application on to MSN messenger.

    Friday, August 31, 2007 2:55 AM