Running an exe application from local resource inside ASP .Net Core HTML page

My software is splitted into 2 parts:

  1. ASP .Net Core 3.1 application which is hosted on server
  2. .NET Framework 4.8 WinForms applicaнion which is deployed on client PC (I can try to place it on server if this greatly simplifies the solution of the problem). The reason why I need this separate application is third-party control that is available only for .NET Framework desktop – WinForms and WPF (unfortunatelly I cannot avoid using or replace it).

Is it possible to run that client PC application inside ASP Net Core HTML page?
I don’t need just launch it with System.Diagnostics.Process or similar techniques, I want I want to embed it in a ASP frame somehow. Something like WindowsFormsHost for WFP or ElementHost for WinForms.

Any help is appreciated. Thank you in advance.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Basically, you have these options:

  • Wrap your desktop app into ActiveX, use IE Tab extension (or similar one), and run ActiveX on the page. The worst one because of, well, ActiveX. In fact, you will not be able to use modern browser features.
  • Throw away Web UI. If you need desktop app (it doesn’t matter why), then use desktop app and Web API at server side. The easiest and obvious one. You’re still linked to desktop, so what is the reason to ignore this fact?
  • Render mentioned control’s output at server side, and send the result to browser. This depends on what the control is, what it does, how much interactivity it requires, etc. Also, this assumes, that you must be able to run .NET 4.8 process on your server and communicate with it from .NET Core app.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x