Unhandled Error in Silverlight 2 Application – Invalid or malformed application: Check manifest

This error is very silly and obviously there is something wrong with the Manifest file as shown below

Webpage error details

Message: Unhandled Error in Silverlight 2 Application
Code: 2103
Category: InitializeError
Message: Invalid or malformed application: Check manifest

Code: 0
URI:

But if this helps anyone, i would like to point out that When you create a silverlight application using visual studio, it copies XAP package in ‘ClientBin” folder. You can either unzip the .XAP file to look at AppManifest.xaml or if you have access to source code then you can direcly open “AppManifest.xaml” file from bin/<> folder.

Make sure these entries are correct

<Deployment
EntryPointAssembly=”SilverlightApplication1
EntryPointType=”SilverlightApplication1.App//this should be same as your “Namespace.Application” class
RuntimeVersion=”2.0.31005.0″>
<Deployment.Parts>
<AssemblyPart x:Name=”SilverlightApplication1″ Source=”SilverlightApplication1.dll(make sure that, this is the output dll you have in your project configuration)/>
</Deployment.Parts>
</Deployment>

By default,    app.xaml will have the application class=”App”, i have changed it to “MyControl” as shown below so if you are using visual studio and you have renamed your project or App class make sure to make the corresponding changes in Project Configuration (assembly name, startup project)

public class MyControl: Application
{
public App()
{
this.RootVisual = new Page();
}
}