views:

83

answers:

1

I've got a problem with the Silverlight default VS2008 project. Wnen I create a new SL project and choose ASP.NET Web Site web project type all is ok - in my browser I see default template. But when I choose ASP.NET Web application and run it I get blank browser screen with js error: Unhandled Error in Silverlight Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings. What's wrong?

A: 

Yeah, this happened to me too. It was my MIME types that were not added. You may need to add these to IIS:
.xaml application/xaml+xml
.xap application/x-silverlight-app
.xbap application/x-ms-xbap

Here's a tutorial on how to do so: http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/

If this isn't the issue, two other things to check:

  1. Is your project targeting the right .NET framework (3.5 instead of 2.0)?
  2. Is your start-up projec the ASP.NET web site project?
Otaku
This isn't really a criticism, just a clarification (answer is spot on), but you shouldn't need to add XBAP and XAML mappings (well, maybe XAML) to your IIS if you don't plan on hosting XBAP (WPF in the browser) applications.
JerKimball
yeah, I hear ya. I never use xbap, but add it for any "just in case" moment. XAML - I add that so I can serve up loose XAML - it's a zillion times faster than loading, building and running a VS project.
Otaku
Yeah, I think you need to add the xaml mappings to do splash screens as well - not sure, since I've never really used 'em.
JerKimball