Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it? - DevCorner

Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Today I've seen very strange and unpleasant error while trying to run some freshly created Silverlight application. It said:

Code# 2103

Invalid or malformed application: Check manifest

Fast search by popular search engines gave me this and this places, but everything mentioned there I've already knew or tried before... So what is it? Let's see what it was and how it was solved. Let's reproduce it.

 

I'm creating new Silverlight 2 project, compiled it it works... My simplest project looks like follows (every button click just adds "!" to Button.Content):

image image

Everything works fine, until I decided to change the namespace in your class.

When changing the namespace in you Page.xaml.cs don't forget to change it also in Page.xaml, App.xaml.cs and App.xaml. This is known, and I did it.

After compiling and lunching the application I received this:

image (if I used <asp:Silverlight/> in a ASP.NET page)

or this:

image (if used <object/> in a HTML page)

Why it happened?

I did the change in all files, I recompiled the project, I have checked that MIME type for ".XAP" is set to "application/x-silverlight" (in case I'm running from real web server and not from ASP.NET Development Server) , I've even cleared the browser's cache...

After checking AppManifest.xml in XAP file I've identified the problem.

The think was missed... ... ... application startup object in project properties!

It was still pointing to "Old Namespace".App!

image

And thus, AppManifest.xml in XAP file was generated like follows (with EntryPointType pointing to non-existent place):

   1: <Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
   2:             EntryPointAssembly="NamespaceChange" EntryPointType="NamespaceChange.App" RuntimeVersion="2.0.30523.4">
   3:   <Deployment.Parts>
   4:     <AssemblyPart x:Name="NamespaceChange" Source="NamespaceChange.dll" />
   5:   </Deployment.Parts>
   6: </Deployment>

The only thing needed to be done is to change Startup object in Visual Studio Project Properties and recompile.

image

Now the manifest generated as it should be and the application works!

So, next time when you changing the namespace don't forget to change the startup object.

 

Enjoy,

Alex

Published Tuesday, July 22, 2008 2:43 PM by Alex Golesh

Comments

# Silverlight Cream for July 22, 2008 -- #332

Alex Golesh With Quick tip on an error msg, Martin Mihaylov rearraning SubImages, Koen Zwikstra with

Tuesday, July 22, 2008 9:45 PM by Community Blogs

# Post: 149

Post: Approved at: Jul-23-2008 InitalizeError #2103 - Invalid or malformed application? Have you run

Wednesday, July 23, 2008 11:18 AM by Mirrored Blogs

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thank you! Worked for me. It saved me a lot of time!

Thursday, July 31, 2008 6:58 AM by Karl

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

You saved 3hours of my lifetime! Thanks! :D

Sunday, August 17, 2008 12:49 AM by Lars

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Karl, Lars:

Welcome :)

Wednesday, August 20, 2008 2:21 AM by Alex Golesh

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Oh thank you so much! This problem has been bugging me for weeks and I was having to modify the xap file every time I wanted to debug my app.

Monday, September 01, 2008 9:08 AM by Beaker

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

very useful information.   I appreciate the time to get the screen shots and show the logical approach to finding the solution

Wednesday, September 17, 2008 8:53 AM by matt

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks!  That was exactly what I needed.  Had it fixed in seconds after reading your post.

Monday, September 22, 2008 7:44 PM by Scott Forsyth

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

this error occured with me when i open any site have silverright Error: Sys.InvalidOperationException:InitializeError Error#2103 in control'Xaml1':2103An error has occurred

I allready have VS2005 & VS2008

How to resolve this Problem

Sunday, November 23, 2008 1:28 AM by Aswanee

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Aswanee: Could you please dive some details on this? Probably source code of your project?

Regards,

Alex

Sunday, November 23, 2008 1:51 AM by Alex Golesh

# Silverlight 2 & Dynamics CRM

I was doing some research on Silverlight 2 &amp; Dynamics CRM integration and found this post by Humberto

Thursday, November 27, 2008 1:52 AM by Technoeuphoria!

# Silverlight 2 &amp; Dynamics CRM at Aimee Gurl&#8230;

Pingback from  Silverlight 2 &amp; Dynamics CRM at Aimee Gurl&#8230;

Thursday, November 27, 2008 1:55 AM by Silverlight 2 & Dynamics CRM at Aimee Gurl…

# silverlight 2 amp dynamics crm

I was doing some research on Silverlight 2 &amp; Dynamics CRM integration and found this post by Humberto

Wednesday, December 17, 2008 6:10 AM by Jocelyn

# Silverlight 2 &amp; Dynamics CRM

I was doing some research on Silverlight 2 &amp; Dynamics CRM integration and found this post by Humberto

Wednesday, January 07, 2009 3:53 AM by jocelyn

# Silverlight 2 &amp; Dynamics CRM

I was doing some research on Silverlight 2 &amp; Dynamics CRM integration and found this post by Humberto

Wednesday, January 07, 2009 4:21 AM by jocelyn

# Silverlight 2 &amp; Dynamics CRM

I was doing some research on Silverlight 2 &amp; Dynamics CRM integration and found this post by Humberto

Wednesday, January 07, 2009 8:43 AM by jocelyn

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

OK, here's another thing that can cause it:

Two resources with the same key in App.xaml (or probably any other xaml file).

<Color x:Key="DefaultTextForeground>#FF000000</Color>

...

<Color x:Key="DefaultTextForeground>#FF000000</Color>

Compiles fine, just get the wonderful Initialize Error #2103.

Saturday, February 07, 2009 3:54 AM by Geoff T

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks for the tip, I had this happen after doing a bit of refactoring and your post saved me some time.

Thursday, February 26, 2009 2:30 AM by Jeff

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks, this works....I changed the namespace and forgot to change in the property pages...

Monday, March 09, 2009 9:16 AM by Joby

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks, this works....I changed the namespace and forgot to change in the property pages...

Monday, March 09, 2009 9:16 AM by Joby

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks.

Friday, March 13, 2009 9:43 AM by forgetu

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

I ran into this problem and your post got me going again. Thanks!

Monday, March 23, 2009 5:05 PM by Scott Marlowe

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thank you! This was a life saver :)

Thursday, April 09, 2009 2:44 AM by Jonas

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Ah, very helpful.  Many thanks.

Thursday, April 16, 2009 3:10 AM by Ken Smith

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Exactly my problem... you saved me!

Saturday, April 18, 2009 5:01 AM by david

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

You're the best! :)

Thursday, April 23, 2009 11:14 AM by Bryan Sumter

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks it worked for me :)

Thursday, April 23, 2009 2:47 PM by Irfan

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

David, Brayan, Irfan, Jonas, Ken & others: Welcome! :)

Thursday, April 23, 2009 8:05 PM by Alex Golesh

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thank you so much for posting this.

Wednesday, May 06, 2009 9:40 PM by Hasan

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

This is a great post, succinct and to the point! Saved what shreds of sanity I have left :)

Wednesday, May 27, 2009 3:19 AM by Matthew

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Great post, it helped me out just now.

Tuesday, June 16, 2009 6:50 PM by Dan

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks dude, you saved me a bunch of time and frustration

Friday, June 26, 2009 8:30 PM by John Carr

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Try to re-create AppManifest.xml

Problem can be with locked file, e.g. if under source control system (sourcesafe).

blog.sweetucan.com

Monday, June 29, 2009 12:02 PM by bikini

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

You just saved me a lot of time and agonizing pain and whatever hair was left on my head.

Thanks so much for taking the time to post this with all the details.

Wish there was a way to return the favor.

Kamran

Monday, July 20, 2009 2:36 AM by Kamran

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks, saved me an hour :)

Wednesday, August 05, 2009 3:37 PM by firas

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks this solved my issue, saved couple of hours.

Wednesday, August 12, 2009 3:01 AM by kalyan

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Dude! I knew someone else would solve this. Thanks for the clarity of the post. Well done.

Wednesday, September 02, 2009 3:32 PM by Matthew McDermott

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Sweet.  Saved me a few hours of banging my head against the wall.

Wednesday, September 30, 2009 2:23 PM by helios

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Thanks for the tip!

Wednesday, November 11, 2009 6:59 AM by Chris

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

we enjoyed going through the blog, you totally knocked it out of the ballpark! I have forwarded a link to my friends, and will definately be back for more reading.

Wednesday, November 25, 2009 11:32 PM by student vibrators

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

Alex, Thanks!

Sunday, December 27, 2009 1:07 AM by Neznajjka

# re: Quick Silverlight Tip: "InitializeError #2103 - Invalid or malformed application" what is it and how to deal with it?

thanks for this tip : )

was stuck on this too.

Thursday, January 14, 2010 7:38 PM by Jeremy

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: