I am using MEF in Silverlight for dynamic download .xap file. I want to download .xap file only one time and then I want to download .xap file only when if there is any change in version of .xap file.
What you describe is normal behaviour. The .xap file will only be downloaded if:
There is a change in the .xap file at the server.
The user clears their cache and so no longer has the file on their machine any more.
We have seen cases where the .xap file isn't downloaded when there has been a change.
What are you seeing that makes you think the .xap file is being downloaded each time?
The last accessed time in your cache merely shows the time the application was last run, not the time the .xap file was last downloaded.
Related
When the Silverlight application is loaded , I expect that Xap file should be in Temporary Internet Files, but can not find it, how can I make sure that my default path and do I have any setting to change this path and is it possible to run silverlight application without Xap file. I mean the Framework loads the Xap file in memory and stores the Xap file in Temporary Internet Files for future use ?
For in-browser applications the plugin relies on the browser's cache ("temporary internet files" in the case of internet explorer). For out-of-browser applications the xap will be stored in a file called application.xap in .../AppData/Local/Microsoft/Silverlight/OutOfBrowser/. or similar.
I'm not sure why you couldn't find it in IE's cache. I clearly see xaps cached in Chrome which is what I mostly use.
I have one web application(.war) file. There is one tool (.exe) which is used for some computation but it is currently outside of this web application. We have a requirement, where we need to package this .exe file and .war file into single .war file, so that user can just click a particular link and .exe will be opened from the .war file.
My question is, is it possible to package both (exe and war) into the single war file? If yes, can please let me know the convinient way. I did some googling but most of the answer shows converting war to an exe file, which i dont require.
A war file is nothing more than a zip archive, as such you can place whatever you want inside.
Now the use case seems strange. Do you intend to download the executable from the website?
I created a customized version of the Silverlight Player. After building/compiling, the .XAP which gets pushed out, it ends up being over 700KB.
I'm not too sure why it's doing this because I'm not adding any new resources. All my changes have all been in the code.
Is there any way to reduce the file size?
You are probably including DLLs you did not intend to. The Copy Local option for DLL references you add is True by default.
A XAP file is just a ZIP file with a different extension so the first thing to do is unzip it and take a look at what is included.
You can use a better Zip program to recompress the XAP file, but that will only gain you another 10%-20% at best.
If it turns out you are really just concerned about initial load time vs. total load time you can load an initial (small) bootstrapper to update the display while loading subsequent modules dynamically (look at PRISM and MEF).
You can check the "Reduce XAP size by using application library caching" option.
By default any system dlls that your application uses will be included in the XAP file. By checking this option they are downloaded as separate zip files.
This won't reduce the total size of the files that your application downloads, but will mean that when you publish an update your users won't have to download all the system dlls again - they'll already have these in their local cache.
This option is primarily used in applications that are split across several XAP files to ensure that only one copy of the system dlls are downloaded for the whole application.
I am developing some application project in Silverlight using deep zoom.I copy my images under ClientBin/Source .However I notice that the associated .xap file is formed only once? I change the code and re-run but still see that there is no modification in the .xap file.Why does this happen?
Copying files to the ClientBin folder is a modification to the associated web project not to the silverlight project. The MSBuild code detects that none of the files that make up the content of the XAP file has changed and hence doesn't bother to rebuild something which would turn out have exactly the same as the last build.
I really want to know what the XAP file on Windows Phone 7 is; how important it is; and how I can create it. Could you help me?
XAP is the application package - it is the distributable unit that allows you to install the application on a device (or emulator). Basically, it is a ZIP file with a different extension. If you change XAP to ZIP, you'll be able to read its contents fairly easy.
The XAP file format was inherited from standard Silverlight, and since WP7 is built around the same fundamental core, the file format remained unchanged.
Here is a pretty good description of what it does (remember, that even though it talks about Silverlight, the same main idea applies to WP7):
http://beyondrelational.com/blogs/dinesh/archive/2010/08/18/what-is-xap-file.aspx
In addition to Dennis' excellent post, one other thing about a XAP file - it's a ZIP file - so if you want to look inside one, then just rename it to .zip and then open it using a normal ZIP browser (e.g Windows explorer)