Silverlight in ASP.Net MVC - Not loading text
For some reason, the Xap开发者_StackOverflow社区 file of my Silverlight project, isn't loaded in the Asp.Net MVC website.
Checked the page -> --> is ok. Checked build -> is ok Checked Xap file -> is there
It could be the Xap is not adjusted after modifying the Silverlight application, but i thought it was autogenerated.
Can anyone help me to fix this problem?
Edit: followup: The Xap is in the ClientBin and referenced in the Silverlight Applications "property" (checked again to be sure). It just won't load when i start the page, it has a black/white background (and yes, when i right-click, i can see the "Silverlight"-menu), but the element itself is not loaded :(.
I have solved it myself.
Their are some reasons.
- It's not yet referenced in your project. Go the the settings for the website and select the Silverlight project.
- The IIS is not yet configured to handle the different Mime-Types, you can find more information:
For IIS Express
For IIS
It should be these mime-types:
- application/x-silverlight-app
- application/xaml+xml
- application/x-ms-xbap
4.Or the Link to the XAP File is wrong. You can check it out with Fiddler2 (which also solved my problem).
Hoped that helped someone :)
I have to guess that you are adding your Silverlight project to an MVC website that was created separately (as MVC is not the default website type for a Silverlight project).
If that is the case, you need to go to your project settings for the website and select the Silverlight Applications
tab on the left, the press Add
and select your Silverlight project. By default that will also add a test page for that Silverlight app to your website (might come in handy for testing).
This creates the relationship that will copy the XAP to the ClientBin folder of the Website.
精彩评论