2
votes

I have a complex and very big WPF XBAP application (for Web based app, running in Partial Trust mode). Since Microsoft will be stopping XBAP support by 2020, we are looking for replacing/migrating the XBAP apps with something else without much code change.

We have evaluated following options and none of them looks very good:

  1. ClickOnce App - most promising, but we are more inclined to Web based solution.
  2. Rewriting the code in Anugular - Last option : Is there is a plugin which can talk to C# code via angular. Also, Angular will not allow writing files on client.

Would appreciate inputs/experience in migrating XBAP apps.

Thanks,

RDV

2
"Microsoft will be stopping XBAP support by 2020", I need a reference for convincing for some migration. This link about EOS in 2019 and 2020 didn't include that. - InQβ
@no1xsyzy, Microsoft will be ending support for IE11 - last IE version which will support XBAP. Edge will not support xbap. - RDV

2 Answers

2
votes

Without much code change?

A web app from wpf would be a total rewrite of everything down to your data layer. Maybe some of those as well.

Web apps live in the browser sandbox. You can load any old script into a web browser and that sandbox stops all those bad guys out there from doing bad things to you like deleting the entire content of your c drive.

With some limited exceptions.

They can write files to local storage. There are various plug ins make that more developer friendly.

You could possibly consider cshtml. This can convert xaml to html5.

http://www.cshtml5.com/

I gather this isn't 100% coverage of all WPF apps at a click of a button though. I'd read the small print and give it very careful consideration before writing all other options off.

In order to "talk to c#" from a web page, the usual approach is to call a web service.

One option to write to local disk is to install that service on the client machine. If you can do that though then a web app is far less likely to be your best option.

That c# web service.

Your c# would be web api. A web api endpoint is pretty much just a public method on a web app controller.

If your devs are all c# and xaml then you're likely to find there's a HUGE learning curve to switch to anything javascript based.

There is a lot to learn with Angular.

Of the frameworks you could pick, Angular is the most "opinionated". You fit in with it. You could well find an alternative like React is more suitable for that reason alone.

In terms of c# on the client itself then your options are pretty limited. WebAssembly is prtty new stuff. If your users don't use IE then that's an option with Blazor. The problem there is Blazor is an emerging technology and not ready to be writing some enterprise app.

https://dotnet.microsoft.com/apps/aspnet/web-apps/client

Next year this will still be bleeding edge stuff. You still have razor CSS and JavaScript to learn.

The thing that's available right now is Xamarin forms. But you have to install these.

Rather more obvious than all those is just a regular installed wpf app. I would recommend this as first candidate. If you dismissed it already then take another look at why.

Maybe you could put it in the Microsoft store.

Good luck.

1
votes

It looks like the only option for minimal change is a desktop WPF app. It is the only platform that uses compatible XAML. Modern applications don't map views to viewmodels the same way that WPF does and xamarin doesn't have the same feature set.

If you convert it into web api you can maintain most of the business logic without significant changes. However, webapi is stateless, so you will need to figure out how to manage state. That is already a much bigger change than sticking with WPF and you still need to re-write the front end.