InitializeError Message: Failed to load a platform extension in Silverlight
If you get an error like:
Unhandled Error in Silverlight Application Code: 2153 Category: InitializeError Message: Failed to load a platform extension. Possibly corrupt or invalid file: …
when you try to launch your Silverlight application (especially if you have the project set to use an autogenerated test page), you should read:
http://forums.silverlight.net/t/185747.aspx/1
In my case the suggestion to turn off “Reduce XAP size by using application library caching” setting at the Silverlight library project settings fixed the issue.
I was using the internal Visual Studio development web server (Cassini), but some people at the discussion thread above also say it can occur in IIS7, with the problem actually being in compression settings (need to turn off option "Enable dynamic content compression”) and they point to the following discussion:
Could you show me more details about your solution? I’m fixing a bug with this error. Actually, “dynamic content compression” hasn’t been configured on server and the error repro …
Please…
Hi, do you mean you’re making a Silverlight app or something else that shows a similar error?
If it is a Silverlight app, then you right click the project in Visual Studio and select to see Properties (not the web site project that hosts the Silverlight XAP, I mean the Silverlight project that makes the XAP) and then at Build tab if I remember well you unselect the option “Reduce XAP size by using application library caching”. That option is described at http://www.wintellect.com/devcenter/jprosise/silverlight-3-s-new-assembly-caching but it in my case it was causing this error, probably combined with the “dynamic content compression” on the server
So my suggestion is to turn off the “application library caching” in your Silverlight project. That will make a single big XAP with any DLLs needed in it, instead of separating system Silverlight libraries to separate XAPs. That separation is useful if you have multiple Silverlight apps, or some app where you deploy new builds often and you don’t want the user to download everything in one bunch. Because of the problem described above, I never used that “application library caching” option at ClipFlair Studio (http://ClipFlair.net), although it would have been useful during the first 3 years that the project was being gradually developed and live deployed at the same time