How to port WPF desktop application to web application? - asp.net

I have a WPF desktop application (using the Prism library) that communicates directly with an SQL Server in Azure. I would like to make this application easily accessible by users in my domain (not necessarily on the same network) without the need to install the MSI. What would be the best way to achieve this?
Preferably, the solution should work in Windows 7 and later and/or in Internet Explorer, Chrome, Firefox.
Should I try converting the application to ASP.NET and run in IIS or is there a better alternative? I've heard of xbap but not sure it's suitable for my needs.

Hope this helps:
WPF app into ASP
Having worked with both WPF and ASP.NET, I don't think you can just "convert" one into the other. Maybe some of the code (such as your Azure server communication feature) can be shared using assemblies, but you would still have to rewrite some (most) of it.

Related

cross-compile ASP.NET website to desktop?

Is there a way to cross-compile or port an ASP.NET based webpage to a native Windows GUI?
I am developing a web app, with an ASP.NET webservice doing much of the grunt work, and an ASP.NET webpage as the GUI. I would like to also offer an "offline" version of the app that doesn't require teaching random people how to manage IIS. Some of my target users will not have internet access consistently when they want to use the app; also, I like not having to rely on an active web connection myself because I'm an old fogey and this web 2.0 stuff is just a fad, right?
The core of the app logic is a library that is disassociated from everything else - the service just provides an API (which I want publicly available for others to use), and that I use for my own app. I could go ahead and design a new GUI in WPF or WinForms, import my libraries and there you go, but I'm lazy enough that I'm curious if there's an automated solution. Or even a semi-automated solution.
If I can target not-Windows as well, that would be nice. I already have a console interface that I used in development of the core library that directly accesses them, which I'm still testing but should relatively easy to make work in WINE but if I can offer more support for offline use to non-Windows users I'd feel better.
You could run that web application on .NET Core in a self-hosted way. That way you get the full IIS feature set and there is no need for the user to configure anything.
You can then use a WebBrowser control to show the application as a GUI app, or just open the web site in the users installed browser.
.NET Core runs on non-Windows as well.

Is it possible to write internet browser available content by WPF?

I know that you can use ASP.NET to do that stuff but: Is it possible to write internet browser available content(website) by WPF or WCF?
Exacly I mean write CRM by WPF to which you can log by browser and use it by browser.
No, you can't write an application with WPF and then run it in a browser.
You can use XBAP to create a browser application that can use the benefits of the .NET framework and all the things you can do in a WPF application.

Make Desktop Application Web Interfaceable

Is there a way to make a desktop application easily interfaceable via Web ? Meaning, can you have a way to interface with a single desktop application as if you were remote desktop'd into the machine but not? I am looking at doing this in ASP.NET or Silverlight.
I'm not sure if this is exactly what you are looking for...
If you were able to create your entire application UI in Silverlight and host it properly (in IIS or whatever) it would then be accessible from anywhere on the web. If you needed the perception of a real desktop app when running locally, you could then just make some simple app (WinForms, WPF, whatever) which contains a web browser control that could also load up the hosted Silverlight app (and just be a transparent browser). Depending on what the application is doing, you would obviously need some sort of service layer (probably in WCF) do to all of the heavy lifting and data access.
I guess the main question would be: can you accomplish everything your application needs to do in Silverlight? Since Silverlight is meant to run in a browser, it can be very limiting.
There are many solutions based on plugins. Some of the popular ones:
Citrix
Spoon
If you're ok with plugins, but only if they're common ones (flash, java), there are various solutions:
http://www.wizhelp.com/flashlight-vnc/
http://www.tightvnc.com/doc/java/README.txt (bundled java applet with TightVNC)
If you don't want plugins at all, there's an experimental HTML5/javascript VNC viewer:
http://guacamole.sourceforge.net/

ASP.Net portable server

I'm trying to start on a new project to help enrich my asp.net knowledge, since I'm not completely satisfied with what my class is teaching me. From my (very little) experience with Rails, I recall every application containing its own development web server. Say I were trying to create a local-only application, but I want it to run in a web browser (Therefore ASP.Net). Are there any options in terms of being able to distribute an application and have it launch its own, or just not require IIS/VS/Apache-mono?
You may want to look into aspNETserve. It sounds like it would fit your needs. I haven't worked on it recently, so it probably has some rough edges.
On the plus side its all open source, and if you are just getting started with ASP.NET it would be a real eye opener on how the internals of the ASP.NET lifecycle operate.
The simple answer is that you need a web server to run the application. It cannot run without one.
If we're talking demo purposes or you don't require that many features of a web server there are redistributable web-servers that you can include with your setup package.
Like Alex mentioned the most popular one seems to be Cassini.
I'm assuming that you want to run the site on the same machine you are developing it on.
Visual Studio 2005 and up allows you to run the site from VS itself if you want to view it locally on your development machine.
To my understanding Visual Web Developer allows you to do the same as well.
Visual Web Developer
You can use the cassini web server. Please note that those are different redistributable:
http://www.asp.net/Downloads/archived/cassini/
http://ultidev.com/products/Cassini/
I'm not really certain why you would want to develop a web application (with all the difficulties it entails, due to the fact that you are dealing with a stateless connection to an unknown client machine), but then run the entire thing on the client machine.
Surely it makes more sense to develop a WinForms application?
Follow this guide to setup IIS on your PC to run ASP.NET apps:
http://www.geekpedia.com/tutorial25_Setting-up-your-ASPNET-server-IIS.html

WPF app into ASP

Is there any way to turn to WPF app into an ASP app? Or are they totally unrelated technologies? XAML format reminds me so much of HTML that it seems like there might be a way.
WPF app is a windows application while an ASP.Net app is a web application. These two platforms have huge differences which make it hard to convert. In most cases this isn't even feasible due to different limitations and strengths of these platforms.
For viewing this might be possible but if the WPF application does anything like write to the local filesystem or modify something on the user's computer this just won't work on the web.
If the application is for internal use, you could look into XAML Browser Applications (XBAP). These have only security limitations which you can bypass by signing the deployment and propagating the correct certificate to the client computers through the Domain. The great part about XBAPs is that they can share assemblies with the WPF application and so converting WPF application to an XBAP is quite trivial.
Silverlight is another possibility but there are quite major differences between WPF and Silverlight and turning a WPF application into a Silverlight application requires more rewriting than one might initially think. The Silverlight engine is built on top of .Net but it uses different virtual machine and isn't binary compatible. It's still easier to port to than to ASP.Net!
Even if you would manage to convert the XAML to ASP.Net HTML you'd have problems with the minor differences in control behaviours. And if your WPF app is using the major WPF features such as embedding controls inside tab page headers or applying transformations don't even think of trying this.
I don't believe there is an easy way to do so; they are indeed basically unrelated technologies. WPF renders to your screen while ASP.NET renders HTML for viewing through a browser, and all the event/data pipelines are completely different.
Though you could convert your WPF app somewhat easily into a Silverlight app if you want to run it on the web.

Resources