Silverlight on-demand compilation/Build - silverlight

Is it possible to build silverlight application in on-demand manner. I have lot of silverlight applications to be shipped. I would like to ship the project files alone. Based on some user interaction, I would like to generate the XAP.

You thought about using a NANT script to compile your project and grab the output xap file?

Related

Deploy WinForm application generating single exe file

I need to deploy a WinForm application and I need to generate just 1 .exe file.
I tried with ClickOnce but it generates also a manifest file, so I can't use it,
and I can not use the Release folder content because there aerseveral files (eg. strings resources)
Thanks a lot!
There's a little tool called ILMerge.
With this it is possible to merge several dlls and exe into one exe.
I don't know if it is possible to integrate resource files as well, but i don't think so.
Have a look at:
ILMerge Best Practices

How does silverlight work in web browser?

How does Silverlight application work in browser?
E.g When I access a page having Silverlight control, how does Silverlight runtime extract data/ dlls from 'XAP' package? does it load all dlls in one go or support lazy loading of dlls?
If you're interested in some of the inner working of how the silverlight plugin and how it reads the XAP visit http://stuff.seans.com/2009/03/23/hello-silverlight-world-part-3-the-lifecycle-of-a-silverlight-control/#comment-826
He sums it up very well.
The Silverlight Runtime will extract and load all the DLLs from the Xap file before executing the entry point. Other files within the Xap will be extracted in an on demand fashion.
If you have significant "data" files in your Silverlight project and they need to be in the Xap add them as "Content" rather than as "Resource".
For larger Silverlight apps there are technologies such as MEF which allow you to divide up your app into multiple XAPs and support the dynamic loading of dlls.
Silverlight xap file is just a zip file that contains all required dll s, and files for executing. browser downloads, than extracts files and start executing using Silverlight player, which is light version of .NET engine. Of course there are technologies for lazy loading dll's too, I guess, if you need it.

large silverlight site (hundreds of pages)

When you surf a silverlight site, I believe it downloads the site to the client.
Excluding practicality, lets say your going to develop a large full silverlight site with nearly a thousand pages of static content.
Is there any way you can set the compiler to divide the silverlight app in small parts that will only download as a user attempts to access different areas of the huge site?
You need to use Managed Extensibility Framework (MEF) of Silverlight.
With it you can create small silverlight projects and load them when you need.
Here are some links:
3 Steps to MEF - Export, Import, Compose from silverlight.tv
When and Where to use MEF from silverlight.tv
Using MEF with Silverlight 4 for Extensibility from silverlight.net
To be more specific it downloads the XAP file to the client, which is the end product for your silverlight project.
(Input) Silverlight project -> (Output) one XAP File (containing the main assembly and its dependencies) compressed in a normal ZIP file, but ironically renamed to take XAP extension.
Yes, this is doable, see my answer HERE, you need the same methodology depending on the control (portion) you need upon a specified condition.

Deploying exe files along with a Silverlight application

We have a WPF application that we want to convert to Silverlight. I understand there are going to challenges in converting the application. We are willing to embrace those challenges as long as it is possible for us to accomplish the end goal.
Our WPF application launches some exe (non-WPF) files. So the question is, can we deploy those files with our Silverlight application? If so, can we still run the application from a browser?
I don't think you can run exe on client machine from silverlight so there is no point of embedding them into xap.
Maybe you can think about multi-targeting your code so you will have one code-base for wpf and silverlight.
Take a look at this article.

Dynamically loading Silverlight XAPs

I have four Silverlight 4 apps, each in their own Visual Studio project, for which I want to write a "shell" to host them so they appear to the user as a single application. To minimize download times, I will download the XAPs and supporting DLLs dynamically. So I will end up with 5 apps - the shell and the four sub-apps. Now my problem:
My apps all reference the Telerik suite, and this is a fairly significant download. When I build my apps, the Telerik DLLs get zipped into each XAP (as expected). So even if I dynamically load the XAPs, the Telerik DLLs will be downloaded multiple times, once for each XAP.
So how do I make it so the Telerik DLLs are downloaded only once (say, by the Shell), and shared by all the sub-applications?
If you go into the Properties window of your various Silverlight projects, and select the "Silverlight" tab, you'll see an option to "Reduce XAP size by using application library caching". If you select that, the support libraries (Telerik, in this case) will get packaged into separate .zip files that can be downloaded separately. See here for more details, including instructions on how to configure your own assemblies for this sort of behavior. (I presume, though I haven't checked, that Telerik has done this with their controls.)

Resources