Updated My Silverlight Surface Version

I have updated the Silverlight "Surface" demonstration with video support, too. The only thing I had to do is to replace the Silverlight.js JavaScript file and change the boolean properties in the createObjectEx to their string representations (true becomes "true").

Inside the .NET source I had to remove the third parameter for the Open method of the downloader object. With the new bits all requests are done asynchronous, so there is no real need of this parameter (see the same change in the JavaScript part of the plugin at Joe Stegman's post). I run my build.bat and everything is working.

Published Monday, July 30, 2007 9:28 PM by Michael Schwarz
Filed under:

Comments

# Updated My Silverlight Surface Version - Michael's Blog

Pingback from  Updated My Silverlight Surface Version - Michael's Blog

# re: Updated My Silverlight Surface Version

Thursday, August 02, 2007 11:50 AM by Stu Smith

Did you come across any "access denied" errors when moving to the release candidate? I wrote a little test application that made use of the downloader in the older version, and it worked fine in the debugger. Now I've moved to the new version of Silverlight (and made the appropriate changes as you described), I get an exception in the "Send" method of my downloader:

A first chance exception of type 'System.UnauthorizedAccessException' occurred in agclr.dll

Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Or if I don't trap exceptions,

[JavaScript Application]

Silverlight error message

ErrorCode: 4001

ErrorType: DownloadError

Message: AG_E_NETWORK_ERROR

I wondered if it's something to do with XSS detection... but then both the debug application, and the files it requests, are from a file:// URL. I've checked that the requested files are present and accessible from a browser too...

If you have any ideas that would be greatly appreciated! I'm sure it's going to be something embarrassingly obvious though.

Stu

# re: Updated My Silverlight Surface Version

Thursday, August 02, 2007 1:50 PM by Michael Schwarz

@Stu: it is not possible to change the uri, i.e. if you have opened the app from http://ajaxpro.info it is not possible to access http://schwarz-interactive.de, the same for file://, of course. Is this what you have done before?

# re: Updated My Silverlight Surface Version

Friday, August 03, 2007 5:58 AM by Stu Smith

I thought it might be something in that area; what confuses me is that I'm running the app under the debugger, so the app runs from a file:// uri, and the resources are also from a file:// uri 'below' the application. What's doubly confusing is that the application worked perfectly before under the debugger using the alpha version.

I'll try to have a better play with it all this evening using IIS as well as the debugger and see if I can make some headway.

# re: Updated My Silverlight Surface Version

Friday, August 03, 2007 3:40 PM by Stu Smith

A quick update... the exact same program that fails under the debugger (file:// uri application, file:// uri media) will work fine under IIS (http:// uri application, http:// uri media).

If this is to do with XSS, then apparently:

http-localhost --> http-localhost is fine, but

file-c-etc --> file-c-etc is not.

I'll report a bug to MS and see what response I get.

# re: Updated My Silverlight Surface Version

Friday, August 03, 2007 4:09 PM by Michael Schwarz

Can you give me the URI where you open the Silverlight app and where do you want to access files? As my understanding is it is not possible to start an Silverlight app on file:///c:/temp and access file:///d:/ (or maybe file:///c:/michael). Did you try to download files from the same folder?

# re: Updated My Silverlight Surface Version

Friday, August 03, 2007 5:28 PM by Stu Smith

In pairs, application and requested file...

This didn't work (ie hitting F5 or Ctrl+F5 in VS):

file:///C:/SVN/Labs/BackdropBrowser/BackdropBrowser/TestPage.html

file:///C:/SVN/Labs/BackdropBrowser/BackdropBrowser/Images/Manifest.txt

This did work (ie simply copied to wwwroot under IIS):

localhost/.../TestPage.html

localhost/.../Manifest.txt

As you can see, in both cases I'm referencing files relative to HtmlPage.DocumentUri. Under the debugger, I get an access error. Under IIS, it all works fine.

Does your "Surface" demo work under the debugger?

# re: Updated My Silverlight Surface Version

Thursday, August 09, 2007 6:47 PM by Silvero van Henningen

When i am debugging my application i get the same error, but from ISS it works fine. Am I doing something wrong, or is it just NOT possible to debug Uri and Downloader code ??

# re: Updated My Silverlight Surface Version

Friday, August 17, 2007 6:47 AM by Stu Smith

FYI, I have submitted this bug to Microsoft:

connect.microsoft.com/.../ViewFeedback.aspx

# re: Updated My Silverlight Surface Version

Tuesday, September 25, 2007 5:10 AM by Dee

Hi, tnx for an excellent demo. I've tried the first version out (without video) and mixed with it some. Now when i try to launch the video compatible version i get the "Get Microsoft Silverlight" logo??.. Any suggestions?

Tnx again

//D

# Silverlight: Microsoft Surface Demonstration

Tuesday, September 25, 2007 6:17 AM by iFX

Silverlight: Microsoft Surface Demonstration

# re: Updated My Silverlight Surface Version

Wednesday, September 26, 2007 9:27 AM by David

Hi, tnx for an excellent app. I've added support for dynamic photo (different sizes and so on) to the "onlyphotoversion". When I'm going to test the new "videoversion" I get the "Get Microsoft silverlight" logo - apparently telling me i don't have silverlight. Probably a newbie mistake but I can't get it to work.. Plz help me out!

david.svee@gmail.com

Regards David