How to solve Unhandled Error in Silverlight Application Code: 2104 « Digital Tool Factory blog

How to solve Unhandled Error in Silverlight Application Code: 2104

I’ve found that I get this error every time I upload a Silverlight application to a new webserver. IIS does not have the correct settings by default.

The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:

Message: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings

The Cause: The Silverlight Mime types (.xaml, .xap and .xbap) are not listed in that websites registered mime types, therefore IIS will not send those files to the browser.

The Solution: Open IIS on the server, go to HTTP headers, click on Mime Types, click “Add New” and add the following:

Extension – Mime Type
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap

Hit Apply and your application will load!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

Tags: ,

 

Written By Steve French

 

13 Responses to “How to solve Unhandled Error in Silverlight Application Code: 2104”

  1. Pavan Kumar says:

    Thank u so much for your solution, it solves my problem, which i am facing from 2 days.

  2. Steve says:

    You're quite welcome, that is an odd error without an obvious solution. Look for more solutions in the future!

  3. Niraj Dave says:

    Thank you very much. good solution with easy step with proper description.

  4. steve says:

    It my problem too. but . I can’t solve it.
    I was registered file name on MAME. but the message still pop up..
    source’s directory is right.
    iis is restart..

    i can’t solve it.. T,.T

    can u help me. on mail plz?

  5. Steve French says:

    Did you double check that all of the mime types were registered correctly? IIS has a funny habit of “Forgetting” changes that have been made.

  6. steve says:

    I solve it!!!!!! thank you T_T

  7. HMai says:

    Thanks so much for the solution. You’re such a saver!

  8. sam says:

    Hi i am facing the same problem, i have cross-check all the extensions are added in IIS, but still getting 2014 error.

    Please suggest what are other possible reasons to look at.

  9. sam says:

    More preciously..below is the error am getting..
    =================================================

    Message: Unhandled Error in Silverlight Application
    Code: 2104
    Category: InitializeError
    Message: 2104 An error has occurred.

    Line: 57
    Char: 13
    Code: 0

  10. DanO says:

    I had the same issue. Checked the MIME types and they we all registered correctly. Using Fiddler I saw that there was a 404 when the page was trying to download the .xap file. Bottom line was the page was trying to download a file that didnt exist.

  11. Elle says:

    Thanks so much, Dano! You pointed me in the right direction!!

  12. This error shows up if your Xap file is not were you point the launch. Verify the path, I had to change it to an unlikely solution. I thought the path was “App/MyApp.xap” but because its an ASP app the correct path was “../App/MyApp.xap”

  13. Very nice post, Thanks for this publishing. Really help me a lot.

Leave a Reply





Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.