Using Silverlight 2 on a production Web Server


I recently ran into an issue with using Silverlight 2 on a production web server.   Basically the Silverlight 2 application worked great on my dev machine, but when hit from the production web server I found the page has the Silverlight control, but just a white canvas, nothing else.

image The problem was that the web server was not set up to handle the .xap file extension that Silverlight 2 uses to encapsulate the code for the application. 

A few options for fixing this issue:

1. For IIS6, simply add the .XAP filetype.

2. For II7, this should just work as IIS7 enables them all by default.

3. Other web services such as Apache, lighttpd, etc.  Just make sure the server is configured to allow access to .xaml, .wmv and .xap files and you should be all set

4.  Sometimes you can’t easily go in and change the setting on the server.   So the solution I actually used was none of these.  I just renamed the .XAP file to .ZIP, changed the reference in my applications .Xaml file and it ran fine! 

 

Hope that helps!

Comments (17)

  1. Rob says:

    Using Silverlight 2, which is in BETA, on a production web server especially for use by users outside of my company would not be possible.  Beta software is not allowed on production servers and especially ones visible to outside users.

  2. BenHayat says:

    >>Sometimes you can’t easily go in and change the setting on the server.   So the solution I actually used was none of these.  I just renamed the .XAP file to .ZIP<<

    Brad, so why didn’t MSFT just use .ZIP to begin with so we wouldn’t have to change it back to Zip? Can you suggest to make the extension to Zip rather than XAP?

    Thanks!

    ..Ben

  3. Silverlight 2 now packs all the files needed to run the application in a XAP file (which is essentially

  4. @Rob: well, when putting Silverlight 2 beta on production web server means that you simple only put a FILE on the web server, nothing different than a TXT file. Silverlight applications will only be executed on the client side, so it is no problem to put any beta Silverlight app on production servers.

    Michael

  5. I recently ran into an issue with using Silverl

  6. ASP.NET, Web Evítate problemas: pon SIEMPRE un nombre de aplicación en Web.config . Una recomendación

  7. ASP.NET, Web Evítate problemas: pon SIEMPRE un nombre de aplicación en Web.config . Una recomendación

  8. I’ll be using this page to link to Silverlight 2 articles and posts (both ones I write as well ones by

  9. Recently, I upgraded my personal blog that contains a little Silverlight animation form Silverlight Alpha…

  10. Silverlight技巧,诀窍,教程和链接

    【原文地址】SilverlightTips,Tricks,TutorialsandLinksPage

    我将使用本页链接到有关Silve…

  11. Mfinanga says:

    How can apache differ from IIS

  12. miguel says:

    This is something really easy to do, but can be confusing. Keep in mind SL will be run at the client

  13. (以下内容全部整理自博客堂Scottgu博客中文版)Silverlight技巧,诀窍,教程和链接 【原文地址】SilverlightTips,Tricks,…

  14. Godaddy and Running Silverlight

  15. truejob says:

    Silverlight技巧,诀窍,教程和链接

    【原文地址】SilverlightTips,Tricks,TutorialsandLinksPage

    我将使用本页链接到有关Silve…