Is Silverlight a good fit for these requirements? - c#

I'm looking for a suitable client side architecture that will meet some or all of the following requirements.
I'm thinking primarily about Silverlight (but I would also consider MVC or WPF depending on your suggestions - I can possibly trade some of these requirements off, or find work arounds).
I'm looking for an assessment of Silverlight being able to fully, partially or not able to support, each of the following, with detail around each if possible:
Must be able to reliably upload large (~100MB) binary files via WCF and MTOM
Must be able to support file downloads, preferably in the background (i.e. through 'synching'), though this could simply be supported through a manual URL if necessary
Should have access to some form of local storage - this could be binary or XML for config purposes, but ideally some kind of database (not fussed which, as long as it is part of the install/app)
Should be able to dynamically configure itself depending on user profile. In other words, where a user logs in, the UI and services available are dynamically determined.
Should support some form of client notification (sound and or tray bubble). Ideally this would be supported via WCF duplex, but could be accomplished through polling.
Ideally, should run on multiple platforms (Win / OSX)
Should be easily deployable - if I need to run Silverlight in full-trust mode / OOB - how do users get new versions?
Should be minimisable to the system tray
Any detail or thoughts you can give me on the above would be much appreciated.
Edit - additional questions
Are there any limitations on local storage/access in Silverlight 5 OOB? Or does it behave like a standard WinForms app?
Is it possible to bundle SQL express with a Silverlight OOB .msi?
What is the best option for dynamically configuring a Silverlight app? I've seen MEF mentioned - is this the preferred approach or are there others?

Must be able to reliably upload large (~100MB) binary files via WCF
and MTOM
Should work.
Must be able to support file downloads, preferably in the background
(i.e. through 'synching'), though this could simply be supported
through a manual URL if necessary
Unless you are running OOB with elevated trust (or SL5 in browser elevated) and thus have limited access to the local file system, you would need to ensure sufficient space in Isolated Storage for the downloads.
Should have access to some form of local storage - this could be
binary or XML for config purposes, but ideally some kind of database
(not fussed which, as long as it is part of the install/app)
See above. Regarding local database support there is an SQLite port for Windows Phone 7 which also works in Silverlight (I've recently tested it).
Should support some form of client notification (sound and or tray
bubble). Ideally this would be supported via WCF duplex, but could be
accomplished through polling.
The notification can be done through Silverlight's Notification Window (supported from SL4 and up). The actual server side notification could be done through duplex channels or Kaazing WebSockets Gateway etc.
Should be easily deployable - if I need to run Silverlight in
full-trust mode / OOB - how do users get new versions?
You can install an OOB Client along with the runtime with an MSI installer and still have the Silverlight standard update mechanism work for you (required Authenticode signed XAP). I've done just that a couple weeks ago.
Should be minimisable to the system tray
AFAIK not possible in SL4. Not sure about SL5.
All the points I have not quoted should work.

Having done some Silverlight development I often feel a bit restricted by the possibilities it offers. In my opinion it is meant to be run within a browser, with a web-like interface. From what you describes it is more of a full app you want so I would recommend WPF and click-once deploy that handles updates automatically.

From your requirements I would suggest WPF, full application support, but when it comes to OS X support, then you have a problem, WPF won't work on OS X, only Silverlight will, so I am afraid you have a few requirements that have conflicts with one another.

Related

Real User Monitoring for a C# Desktop App

I am looking a viable approach to record the usage / performance of various parts of a C# desktop application. I see strong parallels with the web focused Real User Monitoring technique and have access to Datadog to process my data.
Is RUM outside the web a viable approach? I believe I will have to implement the equivalent of the JS Datadog SDK if I want to go down this road, is there a way to do this out of the box?
I want to be able to track user usage for certain function calls and capturing exceptions seem sensible.
There are some event model disconnects between the desktop and web but RUM can be used with Android and iPhone apps as well. I implemented this using the json-schema files in the Android SDK and a bit of trial and error on how I wanted to map function calls into the RUM event model.

Windows UWP - Dynamically Load Assembly In Side Loaded App

It seems to be a deliberate security of Windows 10 Store apps that assemblies not be allowed to be loaded at runtime. I think that this feature is massive overkill and stops UWP development dead in its tracks. However, if it is a rock solid design decision by Microsoft, there is nothing we can do to argue with it.
Instead, I'd like to ask the question, assuming that you were not deploying your UWP app to the store, would it still be impossible to load an assembly dynamically? If it's possible, how?
Please see this feature request: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/18145291-dynamically-load-assembly
Regardless of what environment you deploy your UWP application to, the UWP API will be the same. Choosing to deploy your app internally instead of to the Windows Store will not enable non-supported API features, eg. Assembly.Load().
It seems as though the answer to this question is no.
The game has changed in UWP. UWP is a platform which is geared toward getting apps in to the store. It's a stripped down platform and doesn't appear to allow you to load assemblies at runtime. This was possible in .NET.
However, there does seem to be a way to run UWP style apps on top of the .NET runtime using the Desktop Bridge. I'm not really that familiar with it, but you can read more here as a starting my point. My guess is that if you want to load assemblies dynamically, the best approach would be to use this:
https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-root

Open windows form application from a link in locally hosted website

I have created a windows form application that is a face recogniser using EMGU CV. I also have a website which is locally hosted on my laptop, made using ASP.NET MVC4. I want a link on my website which ,upon clicking, opens the facial recognition software. Is it possible to do it? Do I have to create a setup of application and install it to do this or is there any other way?
The effort involved to do what you are asking for is almost certainly much higher than you are willing to take on. I'm only aware of two possible approaches. The first is to use the Microsoft Click-Once technology, which streams binaries through to the client. However, the binaries arrive at the client very untrusted, so you need to do quite a bit of work on the client to set up the appropriate permissions. The other approach is to associate your image recognition form with one of the safe MIME types, and then stream out a file of that MIME type. If your application is the default application for that type, it will be called to handle that file.

running an application inside ASP.NET

I've written an application in C# that I would now like to host within an ASP.NET website (MVC 2).
The application can become quite resource intensive so I would like to set up the system in such a way that each user downloads the application and runs it locally, but still within the web page that I provide.
My first idea to solve this problem was to host the program within a silverlight application. However, the app I want to host was not compiled for Silverlight, and I would like to use MySQL in it, which also appears to not be possible directly (ie without a web service in between).
The bottom line is that don't have experience with these things directly yet, and I need to research the way to make any solution possible. So I would really appreciate some input to put me in the right direction, and not have to implement 3 wrong options before finding the right one. I would also really like to avoid JavaScript if at all possible.
Thanks in advance.
Update
I probably should have specified to begin with what the application is exactly.
The application as I want to host it on the website is a simple chat program. It needs an input box and text output. The old windows forms application won't have to run in ASP, but I want to use the class library behind it, which is a chatbot engine. That engine is the part that can be rather resource intensive.
So you wrote a "rich client" application and you want to serve it as a web/silverlight application. This is not possible without changing the architecture of your app, as you probably guess, expecially because you have to interface a database. If rewriting the application to support such architecture is not an option, the best in order to me is to use Remote Desktop, but you have to pay for licenses in order to support many connections.
If your application is not a web application then it will not run on the server. The only thing your server does is to provide a download location. For that, you wouldn't need a MVC site - static pages could fit. The programming model between normal applications running on the client and server applications running on IIS is completely different. So in short: you won't be able to host your client application in ASP.NET MVC. If this is a requirement you will end up rewriting the application.
If your application is ASP.NET WebForms and it becomes too resource hungry, then you probably won't solve it by just switching to MVC. You have different options then: more resources on the server side, analyzing what could be done to lower the resources required or moving away from a server based application. This is not a black/white decision, maybe a combination might fit.

WPF in a browser and printing

Can WPF be hosted in a web browser? If so how? (I think it can as I have seen some examples of it.)
While hosted in the web browser what printing support does it have?
What are the drawbacks to using WPF in a browser?
My company is looking for a rich web app platform. They will not choose Silverlight because it ignores any printing needs (at least as far as I understand). Right now a solution from Adobe is in the lead because it supports printing.
Most (if not all) of the apps written for browsers will be used internally by my company (ie we control the computers and browsers). (We want to use browsers for easy of deployment.)
Have you checked out XBAP (Xaml Browser APplications)?
The major drawbacks I am aware of concern security. When some coworkers of mine were developing an XBAP product, they often ran into problems with security, as the XBAP model is pretty strict.
I can't answer about printing, but I'd tend to think that might be a problem with the security considerations.
Hope I was able to help.
If the apps are solely internal and you control the target platform; and the reason for choosing to host your apps in the browser is 'ease of deployment', I would seriously consider writing Full Trust applications in WPF, and deploying them with ClickOnce... Your users would simply have a shortcut on their desktops that would check a server to see if their version of the app is current, and download the newest version if not.
You get all the benefits of the full WPF platform (greater feature-set than Silverlight), and do not need to conform to the Partial-Trust restrictions of XBAP (although you will need to configure the ClickOnce server to allow for Trusted Application Deployment)
No. That's what Silverlight is for right now and yes there are printing limitations. However, printing anything using a web app is not straight forward.
I would suggest Silverlight/Flex solution for web based app and for printing need the best way to do is use iTextSharp library and generate PDF for your reports or printing need, which can be fetched from a URL. PDF is a very standard and adobe reader will always print it right, printing will not be a problem, we went through lot of options and it requires reinventing wheel where else generating PDF through iTextSharp is very easy as creating normal html in javascript way.

Categories