开发者

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

I have a Silve开发者_开发百科rlight 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.


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.


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.


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/


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.


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:


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.


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.


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...


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜