Silverlight: Don't forget to add the XAP extension!

Silverlight 2 now packs all the files needed to run the application in a XAP file (which is essentially a ZIP file). Think of the XAP file a little as the JAR files of Java applets. Because these files must be served by the web server in the correct way, it is necessary to pay attention to this extension (we had exactly the same problem when XBAPs were introduced, or for serving "pure XAML files".

Brad Abrams has a post explaining the problem, and showing how to configure your IIS6 web server. If you have IIS7, you apparently don't need to do anything. If you use a ISP, check with them how to add the MIME type to the web server (note: many ISPs nowadays use IIS7, so you should be all set already.) If you serve Silverlight applications from an Apache web server or any other web server for that matter, you want to configure the MIME types, so check Brad's article :)

Print | posted on Friday, March 14, 2008 10:18 PM

Feedback

# re: Silverlight: Don't forget to add the XAP extension!

left by DaveUK at 3/15/2008 4:41 AM Gravatar
Fantastic ! I've struggled with this for two days.

I'm using IIS7, so I thought I didn't have to do anything. But when I checked the MIME types didn't include .xap. So I added this and everything worked.

Thanks

Dave
UK

# re: Silverlight: Don't forget to add the XAP extension!

left by Laurent at 3/15/2008 8:55 AM Gravatar
OK folks, you heard Dave, even with IIS7 you might have to register the MIME type :)

Thanks Dave,
Laurent

# re: Silverlight: Don't forget to add the XAP extension!

left by ilahiler at 5/14/2008 3:12 AM Gravatar
I'm using IIS7, so I thought I didn't have to do anything. But when I checked the MIME types didn't include .xap. So I added this and everything worked.

# re: Silverlight: Don't forget to add the XAP extension!

left by Laurent at 5/14/2008 8:54 AM Gravatar
Hi,

Thanks for the tip. My comment about IIS7 where you "apparently" don't have to do anything was not mine, but came from Brad's post. I didn't test it myself. Thanks for trying it out, and for commenting!

Laurent
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: