The Silverlight configuration in asp.net is incorrect: InitializeError 2103

Source: Internet
Author: User

InitializeError 2103, configuration error

Cause
Today, I tried to set the Silverlight program to App. xaml in the referenced class library. The result showed that it was not feasible and the following error occurred:

SCRIPT5022: unhandled errors in the Silverlight Application
Code 2103
Category: InitializeError
Message: The application is invalid or the format is incorrect: view the list

The so-called "program list" refers to: AppManifest. xaml. The template for this file is located in the properties folder of the project. Generally, this error occurs because Silverlight cannot find the entry point, just as C Programs cannot find the main function.

Conclusion
App. xaml can only be set as the main application, and cannot be set as a class library. To be accurate, it is not supported by VS 2010. You can only manually package XAP and put the dll that contains the App. xaml entry in the first line of <Deployment. Parts>:

 

The Code is as follows: Copy code
<Deployment xmlns = "http://schemas.microsoft.com/client/2007/deployment" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly = "SLLib" EntryPointType = "SLLib. App" RuntimeVersion = "5.0.61118.0">
<Deployment. Parts>
<AssemblyPart x: Name = "SLLib" Source = "SLLib. dll"/>
<AssemblyPart x: Name = "SLApp" Source = "SLApp. dll"/>
</Deployment. Parts>
</Deployment>

Because Silverlight automatically finds the entry point of the First Assembly, And the xap packaged by VS sets the main application as the first by default. Manual packaging is still troublesome, so I took the initiative to bypass it, or use App. xaml under the main program!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.