Silverlight application doesn't run. I get an invalid or malformed application error
Asked Answered
H

11

14

I have a Silverlight application, and when I click 'run' Internet Explorer starts up and nothing is shown. I get an error icon in the bottom left that, when I click it, result in the following error.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0) Timestamp: Wed, 25 Nov 2009 00:11:41 UTC

Message: Unhandled Error in Silverlight Application

Code: 2103

Category: InitializeError

Message: Invalid or malformed application: Check manifest

Line: 54 Char: 13 Code: 0 URI: http://localhost:50511/TestPage.html

Why do I get this error? And how can I fix it?

I have looked around and other people seemed to get this error when they renamed their application, however I haven't done this.

I have created a custom style, if that might have anything to do with it.

I have done no coding, all I have done is dragging on my style's controls and linked the pages.

Hoarhound answered 25/11, 2009 at 0:14 Comment(2)
What are you using Blend or Visual Studio?Easternmost
I have access to both, but i was using Microsoft Expression Blend 3Hoarhound
H
1

The error occured when I went to object->Edit Style-> Edit A Copy on a 'Sketch' style object. I put the new style in a new resource.

When I removed these styles the error went away. I then remade the styles I wanted from scratch, instead of editing a copy and I did not get the error.

Hoarhound answered 2/12, 2009 at 5:59 Comment(0)
H
33

I've had this error in a few circumstances. Check that the Startup Object in the properties is correct (any namespace changes?). Be sure to explicitly add your Silverlight project as a dependent project for your web project, this is not done by default.

Re-add your Silverlight project under the Silverlight Applications in the web project's properties. Make sure that the App.xaml x:Class matches the code behind namespace and class name. Hmm, I think those are the usual tricks.

I hope this helps.

Hoedown answered 25/11, 2009 at 20:59 Comment(3)
Thanks for that Nathan, the solution was created in Blend so all the projects were setup correctly and all the code was dynamically generated. I had at look at the code in the Namespaces and it seemed correct. I hadn't renamed the projectHoarhound
This solved my problem - I had renamed the application but hadn't changed the startup object in the project properties.Undercast
Dood--may not have been the solution to the OP, but knocked mine out of the park. I'd changed the namespaces and that was the root. Thank you much!Corso
K
8

Just in case this helps someone else:

I was banging my head against the wall for a while trying to figure out why I got this error. Everything seemed correct.

The .xap file is just a .zip, so one is able to manually change information in the ClientConfig after deploying (simply by unzipping the file then re-archiving it). I had been changing WCF endpoint information post-deployment then rezipping. Well, without realizing it I had been zipping the folder, which meant there was a folder inside the zip instead of the contents of that folder being in the root of the zip.

This was a stupid mistake, but from a client perspective, the .xap seemed to be coming across fine. The only error I got was the 2103 error. Moving the files to the root of the zip fixed my problem.

Kedah answered 8/12, 2011 at 14:39 Comment(0)
J
7

I have run into this issue a few times when deploying an existing Silverlight application to a new environment or a repaved dev computer.

When you install IIS, make sure you have the Static Content feature enabled (under Common Http Features), so that you can see MIME Types feature available at the root of the IIS Manager. The type .XAP should be set to application/x-silverlight.

This resolved the issue for me.

Thanks to: http://keremozen.com/2012/10/18/solution-alternatives-to-invalid-or-malformed-application-check-manifest-error/

Jasmin answered 8/2, 2013 at 0:45 Comment(0)
H
4

I got this error when I deleted a resource dictionary from my project that was referenced in App.xaml. Visual Studio built the solution fine and gave no indication that anything was wrong.

When I remembered to delete the line from App.xaml, everything worked fine.

Hinch answered 22/9, 2010 at 15:11 Comment(0)
M
3

Below things worked perfectly for me

(1) Check that the Startup Object in the properties is correct.

(2) Be sure to explicitly add your Silverlight project as a dependent project for your web project, this is not done by default. :Right click on Solution (not on the individual project) > Properties > Project Dependencies > Select Web Project under Project & Check Silverlight Client Project under Depends on. > Apply > Ok.

(3) Re-add your Silverlight project under the Silverlight Applications in the web project's properties.. :Right Click on Web Project > Properties > Silverlight Applications > Click on Add & Select Silverlight Client Project Under Project. :thumbsup:

Munroe answered 20/11, 2013 at 16:50 Comment(0)
P
2

Check to ensure all of the prerequists are installed on the web server. I struggled with this for over 4 hours. Every posting on the web talked about changing the Namespace which I did not do. I eventually decided to try my application on another webserver and the problem went away.

Thanks to everyone posted their fix, but if all esle fails try another computer or check your prereqs.

Privileged answered 1/8, 2010 at 22:46 Comment(0)
H
1

The error occured when I went to object->Edit Style-> Edit A Copy on a 'Sketch' style object. I put the new style in a new resource.

When I removed these styles the error went away. I then remade the styles I wanted from scratch, instead of editing a copy and I did not get the error.

Hoarhound answered 2/12, 2009 at 5:59 Comment(0)
G
1

Even though this is an old post, this same issue had eaten up few hours of my time. The given above solutions had not worked out for me.

By setting the Copy Local = True for all the externally referenced assemblies had solved this problem for me.

Initially visual studio sets Copy Local = True for all the assemblies, but then the project will start to refer from the locally copied assembly(bin\debug). In order to make it to refer the common location, i have set Copy Local= False and so ended up with this issue.

Hope this would save somebody of yours time...

Galbanum answered 29/6, 2012 at 15:33 Comment(0)
R
1

Here is another issue I found. The ordering of BasedOn Styles seem to matter.

The following will cause a WSOD with the errorcode 2103.

<Style x:Key="Style2" TargetType="TextBlock" BasedOn="{StaticResource Style1}" />
<Style x:Key="Style1" TargetType="TextBlock" />

But this will not.

<Style x:Key="Style1" TargetType="TextBlock" />
<Style x:Key="Style2" TargetType="TextBlock" BasedOn="{StaticResource Style1}" />

Took me a long time to find this. It seems like it's actually more of an issue with how the XAML interpreter works, but it's easy to work around.

Rescissory answered 21/4, 2013 at 19:49 Comment(0)
P
1

We experienced the issue after a change in Wcf Query Service. We added overloaded methods to said Wcf service. Like so

    [OperationContract]
    int test(Guid id);

    [OperationContract]
    int test(Guid id, int id2);

When running the application it gave us the error. When we removed one of the 2 methods it ran perfectly fine. Putting it back error came back aswell. Renaming one solved the issue.

Therefore be very catious when doing overloading in Wcf.

Pryer answered 2/10, 2015 at 8:20 Comment(0)
I
0

I also ran into this very recently. I discovered that if I renamed the assembly in the project properties, it didn't update the application HTML or ASPX file.

Irreligious answered 3/8, 2012 at 21:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.