What is the purpose of the AppManifest.xaml file in Silverlight applications? - silverlight

In opening up the .xap file that is generated as output from a Silverlight application I've been tinkering with lately, I noticed a file called AppManifest.xaml.
I've also noticed an option in the property pages for the Silverlight project that appears to allow you to optionally not output AppManifest.xaml for the project. When unchecking that option, however, I get errors when running the application: Invalid or malformed application: Check manifest.
What is the purpose of the AppManifest.xaml file?

Maybe this blog post will help: http://blogs.msdn.com/katriend/archive/2008/03/16/silverlight-2-structure-of-the-new-xap-file-silverlight-packaged-application.aspx. It discusses the .xap file and its parts including the AppManifest.
To save people a link click, in short, it defines the application for deployment, its entry point, and references all the assemblies needed to run.

Related

which files are need to be packaged with cefsharp winforms application

By using CefSharp version 37.0.0 my winforms application is ready to submit in college but I am not getting which files (DLL,exe,pak) are need to be packaged along with project references. I already gone through this article https://github.com/cefsharp/cef-binary/blob/master/README.txt#L104-L106 but still confused in :
Is all .pak files (cef.pak,cef_100_percent.pak,cef_200_percent.pak,devtools_resources.pak and all files from locales folder) are used for developer option?
Can I make separate folder cefSharp reference files?
It's hard to give a definitive complete answer, so: "It depends" on what your application uses. For .pak files e.g. if you are not using the DevTools in your application you can skip devtools_ressources.pak etc. similarly with languages and e.g. WebGL and other of the CEF .dll files.
See https://github.com/cefsharp/CefSharp/issues/527 for a discussion already marked faq-able! it also contains info on setting path for .pak files. You can inspect the binaries etc. of the resulting WinForms application at https://github.com/rfgamaral/SlackUI/releases.
Moving .dll files around is not recommended/supported.
Also see this related SO entry: What is the purpose of the cef.pak file in cefsharp?
In theory, you can see a rundown of all the files here:
https://bitbucket.org/chromiumembedded/cef/src/aefb5ccce879f308f0bcc3ac719c86defe2f9715/tools/distrib/win/README.redistrib.txt?at=master
However, one thing they don't note about not including cef.pak (or disabling pak loading altogether) is that it will cause things like red scrollbars (at least on windows). I've found I need to include cef_100_percent.pak to avoid this.

Convert xap to exe

Can anybody suggest a tool to convert Silverlight xap files to Windows executables? I googled and got this this link but it does not work.
Edit: The Silverlight application has been compiled without the out-of-browser switch and I want to know if there is a solution which does not require me to open the project and recompile with out-of browser mode on.
A XAP file is just a Zip file that has a different extension. You can easily use libraries like SharpLib or DotNetZip to extract the contents of it. You can also manualy change the extension of a .xap file to .zip and then extract it in a folder. When extracted, you would get all the assemblies that were bundled as part of the .xap file.
Everything is clearly explained in the following link,
Extracting Assemblies from a XAP File
This link might be of interest:
http://www.amazedsaint.com/2010/05/how-to-create-offline-installer-no.html
It describes creating an installer that installs silverlight on machines where it is not present, as well as an Out-of-browser silverlight application and start menu links. You can use this installer on machines with no internet connection and no .net runtime installed. So it offers most of the practical benefits of converting it to an exe. I followed that procedure before and found it good.

Localization of a WPF ClickOnce application with LocBaml

I'm trying to use the LocBaml way (this might be my mistake) to localize a WPF application, but this application is deployed with ClickOnce and the publishing process doesn't pick up the localized .resource.dll.
I do add the files to my ClickOnce manifest, and I can see that this part works because when I launch the application, I get an error saying that the application can't find fr\LocalizationTest.resource.dll. (So at least it knows it should be there...)
The normal way to include a file in a ClickOnce application is simply to add it in the Project Properties -> Publish -> Application Files menu, but my localized resources are not in there.
What can I do ?
Turns out adding a dummy Resources.fr.resx in the Properties folder fixed the problem. With that the publishing process picked up the translated .dll and the ClickOnce application worked as expected.

Silverlight object not showing - xap downloading but not launching

After downloading the xap file the Silverlight object remains empty or does not showing.
I tried refreshing the deployed site binaries and the xap but unsuccessfully.
Does anybody has some idea what is happening.
BTW. I have another SL site in the same domain and in the same application pool that starts without problem.
Is your startup object set correctly in project properties? This sort of situation happens if you e.g. move your App class to a different namespace but forget to update the startup object field in settings.
As they are on the same domain, change the site page that is working to point at the faulty XAP. Then you will know if it is a bug in the hosting page or the XAP file.
Also try Silverlight Spy (has free trial period) to see if the Silverlight XAP is valid.
Xaps are just Zip files if you rename them, so you can do some very basic checks manually.
Silverlight applications are client side, so application pool of server has no whatsoever relationship to it.
If you get a blank page (you don't even see the loader of Silverlight or you see it and it hangs) this means your Silverlight application has crashed.
Try to debug and find out what is going on. You probably have some reference issues or XAML errors.
See if all the references are copied into the XAP, (rename .xaml file to .zip and open it).
Look at the 'Output' window in Visual Studio during start of the application.
And last but not least, check your html code of your .HTML file, check the name of the XAP file
Check if your server serves .xap files if not you have to add it to the mime types list
Firstly thanks to everyone for the advices. Problem is solved. Unfortunately, I still does not know the exact reason for the error. The problem was caused Plesk control panel of my hosting company that has changed some settings in web.config files when I asked then to switch a web service under a separate application pool. When we restore a backup copy of web.config silverlight page showed again. I'm not sure which is the exact cause of the problem, but this experience could be of help to all who find themselves in a similar situation.
Normally this happens to me, when I have different event triggers with the same name;
I need to change the name I give to the triggers.

SIlverlight XAP file not refreshing when debugging application

I work on a team building Silverlight apps (version 4). We use SVN and all work on separate parts of the code, and regularly update the project with latest code. The Silverlight app runs from an ASP.NET web app. We are having very frustrating issues when updating our code. It seems like old versions of the XAP are being cached.
Example: Francisco changes the wording of a popup dialog, and commits his changes. A very simple change, what could possibly go wrong? I get the latest code. I see the new code in my IDE (VS2010), and run it. When I view that dialog, it does not have the new wording, even though I can see the new wording in my files. I put a breakpoint on the code right where the change is, but when I run the app, the breakpoint is disabled!
I try Clean build of the Silverlight and the Web host. I kill my local ASP.NET development server. I run the app - same thing! I delete the xap from ClientBin. No good.
Each of us on the team are experiencing this issue. Now we occasionally solve it, but are never sure what exactly fixed things, which is not satisfactory.
There must be some setting or something that we are missing. You would think that deleting the ClientBin xap file would solve it, as the new XAP must come from compiling the Silverlight app, right?
If you've seen this problem before and have a real solution, please let me know. (The solution of "format your hard drive and re-install everything" will NOT be accepted!)
Thank you,
Daniel Wiliams
I recommend that you use IE for Silverlight development. See also this answer.
The problem with using Firefox for development is that Firefox runs plugins in a separate process (plugin-container.exe). When launching the debugger, VS doesn't know that Silverlight won't be running from the process it launched, so it doesn't attach to the correct process. The breakpoints in Silverlight code appear not to work because the VS debugger hasn't attached to any process running the Silverlight code.
I believe it's possible to disable the use of the plugin-container.exe process (see, for example, LIMPET235's post here), but that won't fix the apparent caching you're also experiencing.
I used to use Firefox for Silverlight development, but I found that things worked much more smoothly when I switched to using IE.
First of all, could you please check is your .xap file also included into source control?
it should not be included..., no need IMHO.
Most likely your xap file is set to read only.
go to that file location and make ClientBin folder not read only if is.
I've seen this before the XAP file is cached. Try emptying your browsers cache and then putting a query string on the XAP. So your XAP reference would look something like Foo.xap?1234
couple things to check.
Make sure your silverlight project's output path is correct.
Make sure your silverlight application has been added to your web app project.
Enable silverlight debugging in your web app project.
Set the silverlight project as a dependency in your web application's settings
The solution of "format your hard drive and re-install everything" will NOT be accepted!
Format your hard drive and install Linux (:
More to the point, configure the Silverlight Applications tab in the SomeSilverlightApp.Web project to copy the xap file from the SomeSilverlightApp project to the ClientBin folder which shows there by default.
The ClientBin folder is also part of the SomeSilverlightApp.Web project in my case and the xap properties are set to CopyToOutputDirectory: Always so that it also gets deployed.
This is probably not the right solution but it works here and I have not time to try to investigate this weird logic.

Resources