When debugging Silverlight today, I encountered a strange error (error: 2103 invalid or malformed application: Check manifest ):
Error: unhandled error in Silverlight Application
Code: 2103
Category: initializeerror
Message: Invalid or malformed application: Check manifest
I searched for a solution to this error, most of which is *. the xap compressed package contains fewer items. Rename the xap into a zip file and open it to check whether the XAML file exists. This article is useful in comparison with this article. But I did what they did, and the problem still exists.
After a few hours, I finally got it done. In order to enable international multi-language support, I manually modified the project file. csproj, which contains the multi-language part:
1:<Supportedcultures>
2: En, fr-fr
3:<Supportedcultures>
And in fact I didn't add XXXX. En. resx resource file (XXXX. fr-FR.resx) is there.
The problem is caused by this reason.
Solution:
Add an XXXX. en-US.resx and add:
1: cultureinfo culture =NewCultureinfo ("En-US");
2: thread. currentthread. currentuiculture = culture;
3: thread. currentthread. currentculture = culture;
This solves the problem.
Conclusion: errors reported by Silverlight are often irrelevant. Please be careful. (In addition, Silverlight's multi-language internationalization is really worse than flex, rather poor-you have to manually modify the project file. csproj file, which is really Bt .)
Supplement tips-other possible reasons:
1. You modified the namespace, but the. app name in the project property is not modified. As a result, the project properties, app. XAML, app. XAML. CS, and silverlightcontrolhost are inconsistent. For details, refer to this post.
2. the constructor of the multi-language resource file is internal rather than public (this value may be automatically generated in the middle and modified by vs2010, and Bt is compared)
3. if you define resources in APP. XAML and contain duplicate keys, this error will also be reported: Initialize Error #2103.
4. Repeat copylocal-repeat the referenced DLL. Set copylocal = true in one place and copylocal = false in other places.
5. No. xap and. XAML mime are configured for IIS. For details, refer to this post.