Silverlight Controls and Silverlight Toolkithttp://forums.silverlight.net//35.aspx/1?Silverlight+Controls+and+Silverlight+ToolkitDiscussions around using and developing Silverlight controls and the Silverlight ToolkitMon, 01 Jan 0001 00:00:00 -050035164497http://forums.silverlight.net//p/67600/164497.aspx/1?Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageTrying to run Silverlight App from public Azure Blob Storage <p>Hullo there</p> <p>I'm hosting my alpha Silverlight game website on Azure (at <a href="http://q.cloudapp.net" title="this page" target="_blank"> q.cloudapp.net</a>).&nbsp; At the moment, I've included the XAP file as part of the web package, but this is problematic because every time I want to rebuild my Silverlight App I have to re-upload the whole package, taking upwards of 15 minutes to upload, stage then deploy.</p> <p>For this reason,&nbsp; I have tried to move my XAP file to within a public access container in Azure Blob Storage. I can confirm that the XAP file is there and publically accessible by URL from a browser.&nbsp; So, presumably, to access it, the code at q.cloudapp.net/foo.html becomes:</p> <pre class="prettyprint"><i>...<br>&lt;<span class="kwd">object id=</span>...&gt;<br>&lt;param Source="http://cant.remember.url.core.microsoft.net/thegame/TheGame.XAP"&gt;&nbsp;&nbsp;</i></pre> <p>Unfortunately, when I do this, the silverlight App loads within the browser, all the way up to 100% and then... absolutely nothing happens.&nbsp;&nbsp; If EXACTLY the same XAP file is included locally in cloudapp.net, then it works.&nbsp; I have tried re-starting the browser to avoid any caching issues.<br> </p> <p>&nbsp;</p> <p>Some important observations:</p> <p>- If I replace the XAP with an incredibly simple 'hello world' example, then it does definitely work.&nbsp; So it must be something about my XAP, I assume.<br> </p> <p>- If I examine the http requests using a Fiddler-type plugin for Firefox, I can see that the XAP file is requested, transfers to my browser, but then no further file requests are made or denied.</p> <p>&nbsp;</p> <p>I'm tearing my hair out!&nbsp; I thought it might be something to do with the fact that my XAP does, fyi, try to access local files on the webserver.&nbsp; I have copied all these to blob storage just in case, but to be honest if there are no file requests being made within Fiddler, then surely it can't be this?&nbsp; As far as I can see, it doesn't actually get to the point of executing the Silverlight App at all.<br> </p> <p>Are there any known issues or can anyone give me some pointers on how I might even go about trying to debug this.</p> <p>Best wishes,</p> <p>&nbsp;</p> <p>Carlos </p> <p>&nbsp;</p> <p>PS: All testing of the new blob-hosted XAP was done using the local developer fabric, and never deployed (as it doesn't work)<br> </p> 2009-01-22T10:18:15-05:00164553http://forums.silverlight.net//p/67600/164553.aspx/1?Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Trying to run Silverlight App from public Azure Blob Storage <p>Check if this has something do with MIME type not being registered on web server. See the following post that talks about it. </p> <a href="http://www.topics4life.com/post/2008/12/28/SilverlightError-2104-Could-not-download-the-silverlight-application-check-the-web-server-settings.aspx">Silverlight XAP Mime Type Registration</a> 2009-01-22T12:28:58-05:00164562http://forums.silverlight.net//p/67600/164562.aspx/1?Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Trying to run Silverlight App from public Azure Blob Storage <p>No, I'm pretty certain the MIME types are registered fine - if they weren't, the Silverlight plugin wouldn't begin it's 'circle of blobs' loading routine...</p> <p>&nbsp;<br> </p> 2009-01-22T12:58:41-05:00166440http://forums.silverlight.net//p/67600/166440.aspx/1?Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Trying to run Silverlight App from public Azure Blob Storage <p>Hello, by default, you&nbsp;can't reference an xap file&nbsp;on another domain. But you can modify the settings.</p> <p>Please unpack the xap package, open AppManifest.xaml, and add a property:</p> <p>ExternalCallersFromCrossDomain=&quot;ScriptableOnly&quot;</p> <p>Now back to your hosting html page, add the following property to the object tag:</p> <p>&lt;param name=&quot;enableHtmlAccess&quot; value=&quot;true&quot; /&gt;</p> 2009-01-27T07:23:15-05:00166771http://forums.silverlight.net//p/67600/166771.aspx/1?Re+Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Re: Trying to run Silverlight App from public Azure Blob Storage <p>Yi-Lun</p> <p>Thank you so much for this!&nbsp; I searched high and low and was unable to find any relevant articles or pointers, and you have very much helped - it now works, and the evidence can be seen at http://www.squarepeggame.com </p> <p>Thanks! </p> <p>&nbsp;</p> <p>Carl <br> </p> 2009-01-27T20:59:14-05:00166772http://forums.silverlight.net//p/67600/166772.aspx/1?Re+Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Re: Trying to run Silverlight App from public Azure Blob Storage <p>EDIT:&nbsp; <strike>By the way, is there any way to get the Silverlight App to access local files in blob storage relative to its own directory?&nbsp; (without specifying the absolute URL) Or will the App by default use files from the domain of the host web page?&nbsp; I keep various sound files that are used in the game and it would be helpful if they, too, could be held in the blob rather than as part of the Web Role.</strike></p> <p>&nbsp;Answered my own question:<br> <br> </p> <p><style> <!-- @font-face {font-family:"Cambria Math"} @font-face {font-family:Calibri} p.MsoNormal, li.MsoNormal, div.MsoNormal {margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; font-size:11.0pt; font-family:"Calibri","sans-serif"} .MsoChpDefault {font-size:10.0pt} @page Section1 {margin:72.0pt 72.0pt 72.0pt 72.0pt} div.Section1 {} --> </style></p> <p class="MsoNormal"><b style=""><u><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">TO GET A FILE FROM LOCAL Resources inside XAP</span></u></b></p> <p class="MsoNormal"><span style="font-size:10pt; line-height:115%; font-family:'Courier New'; color:rgb(43,145,175)">StreamResourceInfo</span><span style="font-size:10pt; line-height:115%; font-family:'Courier New'"> sr = <span style="color:rgb(43,145,175)">Application</span>.GetResourceStream(<span style="color:blue">new</span> <span style="color:rgb(43,145,175)">Uri</span>(&quot;TheGame;component/Sounds/file.mp3&quot;, <span style="color:rgb(43,145,175)">UriKind</span>.Relative));</span><span style="font-size:10pt; line-height:115%; font-family:'Courier New'"> <br> meMusic.SetSource(</span><span style="font-size:10pt; line-height:115%; font-family:'Courier New'; color:rgb(163,21,21)">sr.Stream);</span></p> <p class="MsoNormal"><b style=""><u><span style="font-size:10pt; line-height:115%; font-family:'Courier New'"><span style="text-decoration:none">&nbsp;</span></span></u></b></p> <p class="MsoNormal"><b style=""><u><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">TO GET A FILE FROM XAP Resources first, then search XAP domain</span></u></b></p> <p class="MsoNormal"><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">meMusic.Source = <span style="color:blue">new</span> <span style="color:rgb(43,145,175)">Uri</span>(<span style="color:rgb(163,21,21)">&quot;Sounds/file.mp3&quot;</span>, <span style="color:rgb(43,145,175)">UriKind</span>.Relative);</span></p> <p class="MsoNormal"><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">&nbsp;</span></p> <p class="MsoNormal"><b style=""><u><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">TO GET A FILE FROM DOMAIN OF HOST WEBPAGE&nbsp; (requires cross-domain permission)</span></u></b></p> <p class="MsoNormal"><span style="font-size:10pt; line-height:115%; font-family:'Courier New'">newMediaElement.Source = <span style="color:blue">new</span> <span style="color:rgb(43,145,175)">Uri</span>(System.Windows.Browser.<span style="color:rgb(43,145,175)">HtmlPage</span>.Document.DocumentUri, FN);</span></p> <p class="MsoNormal">&nbsp;</p> 2009-01-27T21:00:27-05:00376247http://forums.silverlight.net//p/67600/376247.aspx/1?Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Trying to run Silverlight App from public Azure Blob Storage <p>&nbsp;hi <a href="http://forums.silverlight.net/members/Yi_2D00_Lun-Luo-_2D00_-MSFT.aspx" class="namelink" title="Yi-Lun Luo - MSFT"> </a></p> <p>&nbsp;</p> <p>for me its displaying the blank page,</p> <p>&lt;div id=&quot;silverlightControlHost&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;object data=&quot;data:application/x-silverlight-2,&quot; type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;source&quot; value=&quot;http://blob.core.windows.net/Sample/Helloworld/ClientBin/HelloWorld.xap&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;onerror&quot; value=&quot;onSilverlightError&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;enableHtmlAccess&quot; value=&quot;true&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;minRuntimeVersion&quot; value=&quot;3.0.40624.0&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;param name=&quot;autoUpgrade&quot; value=&quot;true&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=141205&quot; style=&quot;text-decoration: none;&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;img src=&quot;http://go.microsoft.com/fwlink/?LinkId=108181&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-style: none&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/a&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/object&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;iframe style='visibility:hidden;height:0;width:0;border:0px'&gt;&lt;/iframe&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/div&gt; </p> <p>&nbsp;</p> <p>i have copy the URL from blob storage abd paste it in source.</p> <p>in silverlight i have add&nbsp;</p> <p>&lt;Deployment xmlns=&quot;http://schemas.microsoft.com/client/2007/deployment&quot;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; <b>ExternalCallersFromCrossDomain=&quot;ScriptableOnly&quot;</b><br> &gt;<br> &nbsp;&nbsp;&nbsp; &lt;Deployment.Parts&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/Deployment.Parts&gt;<br> &nbsp;&nbsp;&nbsp; <br> &lt;/Deployment&gt;</p> <p>&nbsp;</p> <p>After i have run the Webrole project , i have getting the blank page. &nbsp;</p> <p>can you help me out.</p> <p>&nbsp;</p> <p>Thanks in Advance <br> </p> <p>&nbsp;</p> <input id="gwProxy" type="hidden"><input id="jsProxy" type="hidden"> <div id="refHTML"></div> 2010-03-10T15:55:30-05:00391597http://forums.silverlight.net//p/67600/391597.aspx/1?Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Trying to run Silverlight App from public Azure Blob Storage This took me forever to figure out. After playing around with everything mentioned here, this was my problem: http://www.thetechnologystudio.co.uk/technologyblog/index.php/2009/06/hosting-silverlight-applications-in-azure-blob-storage/ <br> <br> I had uploaded the file through my web app when it starts, and the content type was set to application/octet-stream. It needs to be application/x-silverlight-app to load correctly. 2010-04-06T23:14:49-04:00533414http://forums.silverlight.net//p/67600/533414.aspx/1?Re+Re+Re+Trying+to+run+Silverlight+App+from+public+Azure+Blob+StorageRe: Re: Re: Trying to run Silverlight App from public Azure Blob Storage <p>I was also struggling similar way , you may needs to two more&nbsp;&nbsp;items</p> <p>1. Use <strong>fidler/HttpWatch </strong>to see how far the call goes . This will also let you know that whether the .xap file recognized as the Siverlight file </p> <p>2. Make sure the appropriate MIME type is added in IIS </p> <p>3. Do a iis reset after the changes in step 2</p> <p>This may help</p> 2011-03-11T17:49:48-05:00