0

We have a ASP.NET MVC5 (Business) Web-Application (hosted on our webserver) and need to share and/or grab local data/files from the users (business customer) computer.

For example:

  • Local foreign Desktop-Applications > this application need some data (e.g. xml-file) from our ASP.NET MVC-Application and maybe we will get back some data (e.g. xml-file) with results. At the moment the user can download only the file to the browsers Download-Folder, and copy the file to the predefined destination folder of the foreign Desktop-Application. The user need to manually upload the resulting xml-file to our application.
  • Scanner: If the user scan something he can only manually upload it (for some scanners he also have to manually open the scan folder) - Drag & Drop is nice, but it would be more comfortable if this happens automatically. User don't want to Drag & Drop files.
  • local Payment terminals (POS-Terminal) which are connected with USB or locally at the customers network > I can't interact with it from our Web-Application.

There would morge examples for other desktop applications / local devices which I can't access from an Web-Application.

Now our idea was to write a local .NET Core application which acts like a webservice, e.g. RESTful API where I can allow CORS-Header for my Web-Application > so we can communication locally. (We have also thinked about browser plugins, but this wouldn't be easy to support all browsers).

It should run locally on windows / mac and without the need for a webserver (e.g. IIS). A user GUI isn't necessary at all - but it would be great to do some settings (like folders for the foreign applications) or updating this application.

Can this be done with .NET Core?

Phoniex
  • 171
  • 9
  • 1
    Yes, it can be done with .NET core. I think your proposed architecture needs some clarity, however. What you probably want is an over-the-internet application-update mechanism, not a faux web service. – Robert Harvey Mar 09 '20 at 18:20
  • See [here](https://stackoverflow.com/questions/12787761) for some ideas. – Robert Harvey Mar 09 '20 at 18:22
  • Ok and how would this work with .NET Core (disregard the update-mechanism for the first). Would it be a console-, desktop- or asp-application? If possible I would prefer an ASP.NET Core Application > but can I run it without the need to install a webserver on windows and mac osx? – Phoniex Mar 09 '20 at 19:08
  • ASP.NET Core is server-based by definition, even if that server is as simple as a Node instance. – Robert Harvey Mar 09 '20 at 19:10
  • I have checked you link for "over-the-internet application-update mechanism" but I don't unterstand how this helps. Basically I want something to share data/files between the browser and the local computer of the customer. Your link shows how to "auto update" an application. **e.g. POS-Terminal: the Web-Application communicates with a REST-API from browser directly with a local .NET Core App (possible with CORS-Headers) > Request with payment data (price, reference) to local app > proccess the communication with POS > returns result to the browser Web-App** – Phoniex Mar 09 '20 at 19:39
  • Your desktop can call the ASP.NET Core app directly to get the file in question. If you gotta an UI you could register an [custom schema handler](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN) so when you click that special link, it opens in your desktop application (i.e. myapp://order/1234) which translate this into a call to http://myapi.com/api/order/1234) and process it there – Tseng Mar 09 '20 at 19:55
  • I found out that is possible to use a "self-hosted asp.net core app" - as I unterstand I don't need IIS in this case. Isn't that what I have searched for > or did I miss something? **Does anyone know if the self-hosting works also on mac-osx?** – Phoniex Mar 09 '20 at 20:24
  • ASP.NET Core is supposed to be platform-independent. – Robert Harvey Mar 09 '20 at 20:28

0 Answers0