Silverlight Out of browser and on demand loading of assembly - silverlight

I want my silverlight application to work out of browser and it should support on demand loading of assemblies as well.
If i implement on demand loading of assemblies, what will happen in case of out of browser support, will it work fine? or it will download all the assemblies during the installation itself.
Thanks,
Mrinal Jaiswal

In your case, an exception will be thrown when the code of retrieving the assembly is hit and there is no internet connectivity, whether its running OOB or in a webpage.

Related

Run WPF application in browser

I have my application wrote in WPF. Now, i want it to run in browser so I've read about it and I know that XBAP is my solution.
What is my problem? It won't run on my PC. I checked every popular browser (chrome, FF, IE, opera) and nothing. Browsers can't handle .xbap files and just downloads it.
I try and try and nothing but above happened. Can anyone guess why it don't work? Is it deprecated technology, i have too-new browsers or what? Every entries I found about it are 2-4 years old.
Firstly for Internet Explorer (IE9 onwards) you need to ensure that you have enabled XBAP/XAML support:
For Firefox and Chrome you have to do something a bit different:
How can I get my XBAP to run in my browser instead of downloading it on Windows 7?
But in addition to the above you need to be aware that when you run an XBAP application it runs in the Internet Zone....so your biggest problem is that normally you don't have full-trust...therefore your application can't call privileged code...if it tries to then you get security exceptions.
http://www.tarkia.com/blog/tag/difference-between-wpf-application-and-xbap-application/
http://www.tarkia.com/blog/2009/11/26/understanding-xbap-full-trust-partial-trust-certificates-and-more%E2%80%A6/
One way to get your XBAP to be "trusted" is to get it signed with a certificate (you should purchase a proper one from Verisign rather than use a test certificate) and deployed with ClickOnce.
http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/05/wpf-xbap-as-full-trust-application.aspx
http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/31/how-to-run-wpf-xbap-application-in-full-trust-mode-post-2-certificate-extraction.aspx
http://scorbs.com/2007/01/10/xbap-trust-levels/
Or you can keep your application as a regular WPF .EXE and use ClickOnce to deploy it from a website but run it locally with full trust.
not straight forward way, you can find you answer Microsoft MSDN Forum

Silverlight : Client requirements

I am new to Silverlight.
My questions are as follows
I know that Silverlight works with windows OS and Machintosh OS. But does it works with Linux/Unix?
If I run my Silverlight application on a server and access it through a client over the web, does the client need to have a Silverlight plug-in or its installer
With repect to the above point, what happens if I access the same Silverlight application through an Iframe from a normal HTML without having the Silverlight plug-in.
Links to your answers will be appreciated
Moonlight is an option in linux.. and yes you can run silverlight apps in linux http://www.go-mono.com/moonlight/
you will host you app on web server. and of course it will require silverlight plug-in to be installed on it in order to run the application on client.
no silverlight plugin means you can't run silverlight apps.. if you have plugin installed you can even run it in iframe.
Conclusion: in simple words silverlight app is nothing but follows the same requirements like Flash.
Regards.

CoreClr hosting within different browsers

As I understand, When you run a silverlight application (atleast for case of IE), there is a mini-CLR that build within IE that run as part of the silverlight application.
What happen if I am using some other browser like FireFox, Chrome or Safari. Does these browsers also have CoreCLR embedded within? May be I am just no clear about the architecture as how CoreCLR engine is hosted within different browswers and any info/links will be helpful to understand it.
Silverlight is run in browsers using a browser plug-in, in much the same way as with Flash. To quote the Wikipedia page for Silverlight:
The run-time environment for Silverlight is available as a plug-in for most web browsers.
Once you've installed the plug-in, you can use Silverlight in IE, Firefox and Chrome. The Wikipedia page I linked to above suggests Safari might not support Silverlight, but I haven't tested that.

Unloading dll's from SIlverlights App Domain

Is it possible to unload a Dll that I previously dynamically loaded into my App?
Background/comments:
1.- We have a requirement that third party developers will implement a wizard-like activity that will be dynamically loaded and executed into our Silverlight application.
2.- We will probably use MEF to put the XAP and Dll catalog into the Silverlight App Domain.
3.- With MEF, its possible to unload the catalog objects, but the Dll will remain loaded into the App Domain.
What we are looking for is to get rid of those Dlls in memory, as the appliance that runs the SL application can remain powered on for long time, and we don't want to pollute its memory with unnecessary Dlls.
Any ideas?
You cant unload a single dll from an appdomain on any version of th clr, the only option for unloading dlls is unloading the entire appdomain.
Unfortunatly you cant create your own appdomains in silverlight as far as i know, but you could always have multiple silverlight apps on the same page.
i wonder though if its a long running app, if its not better to look at desktop .net.. you could use the .xbap deployment format if you still want to run your app in the browser

Silverlight widgets cross-plateform?

Can I use Silverlight to build cross-platform desktop widgets?
Silverlight Vs WPF
First of all, WPF is not exactly Silverlight. They essentially require different run times. Silverlight Runtime is a subset of .NET, and needs to be installed by the client, to view your SL applications over a browser. Presently SL runtime is available for Windows and Mac. Moonlight is still not full fledged, and is evolving, for Linux.
WPF, on the other hand, is purely on top of .NET runtime, and is available only for Windows.
You can use XAML to develop user experiences in Silverlight and WPF, and as long as you stick to the Silverlight subset, you can compile your XAML in WPF as well.
Desktop Widgets
Now, your thought about building cross platform 'desktop' widgets - Do you want to host a Silverlight application in a desktop window? Silverlight 3.0 provides support for hosting silverlight controls out of the browser.
Otherwise, see my blog entry on hosting Silverlight using a browser shell. http://amazedsaint.blogspot.com/2008/12/thinking-outside-silverlight-sandbox.html.
This post is revolved around
Hosting the HTML Page with Silverlight
in a Winforms/Webkit desktop application
using a web browser control, and
communicate to and fro using HTML
DOM
Embedding a light weight web server
with in the Host application, and
handle requests to perform such
operations
But remember - it is not WPF. Hope this clarifies.
In Silverlight 2.0, you won't have any such luck.
In Silverlight 3.0 (currently in beta), however, support has been added for Out of Browser Capabilities, which means you can download and run Silverlight apps from your desktop.
The Silverlight platform in general is cross-platform, so external (desktop) aplications in Silverlight 3.0 will be exactly the same.
Quoted from the What’s New in Silverlight 3 Beta? section of the release page:
Out of Browser Capabilities. The new out of browser experience in
Silverlight 3 enables users to place
their favorite Silverlight
applications directly onto their PC
and Mac, with links on the desktop and
start menu—all without the need to
download an additional runtime or
browser plug-in. Further, the new
experience enables Silverlight
applications to work whether the
computer is connected to the Internet
or not—a radical improvement to the
traditional Web experience. Features
include:
Life outside the browser. Silverlight applications can now be
installed to and run from the desktop
as lightweight web companions. Thus,
users can take their favorite Web
applications with them, regardless of
whether they are connected to the
Internet or not.
Desktop shortcuts and start menu support. Silverlight applications can
be stored on any PC or Mac computer’s
desktop with links in the start menu
and applications folder, and so are
available with one-click access.
Safe and secure. Leveraging the security features of the .NET
Framework, Silverlight applications
run inside a secure sandbox with
persistent isolated storage. These
applications have most of the same
security restrictions as traditional
web apps and so can be trusted without
security warnings or prompts,
minimizing user interruptions.
Smooth installation. Because Silverlight applications are stored in
a local cache and do not require extra
privileges to run, the installation
process is quick and efficient.
Auto-update. Upon launch, Silverlight applications can check for
new versions on the server, and
automatically update if one is found.
Internet connectivity detection. Silverlight applications can now
detect whether they have Internet
connectivity and can react
intelligently including caching a
users’ data until their connection is
restored.

Resources