I am trying to migrate a simple WinForms app to a ASP.Net web app. WinForms app is basically only a presentation layer for a complex plain C app, and interacts with legacy code through COM interop. I have modest experience in ASP.Net, javascript, jQuery, and lots of experience in WinForms and interop, so I know the basics, I just need to make a design decision.
The way the app looks right now is this:
There is a bunch of legacy C (not even C++) code which can be changed and recompiled, but porting is not an option. This is the business+data layer, call it what you want. I'll refer to it as legacy code.
When started, legacy code instantiates a COM server which is used for presentation and user interaction. Presentation data is serialized and sent to this COM object ("I'm sending you some output."), and user interaction is achieved through cyclic polling ("Do you have some input for me?"). Not the prettiest solution but simple as hell.
COM object is actually a .NET 2.0 WinForms app exposed as COM. This app also exposes some functionality to other .NET apps through .NET Remoting, but that is not so important also.
Although the system is rather complicated, WinForms app is really used for interaction only, so it's pretty easy to switch to web. What I am not sure is what's the best way to do the web server <---> legacy code interaction.
The first thing that comes to my mind (since I already have .NET Remoting implemented) is to expose the WinForms functionality to the Web part through local .NET Remoting, making it act like some sort of a proxy between legacy code and web app. I would actually only need the communication part, without forms. In that case, web app would have to access this functionality through .NET Remoting (locally).
Is it wise to have web app communicate locally to another app using .NET Remoting? Also, I could change the app to a Windows service, but would I still be able to expose its functionality through COM to legacy code?
What would be a better way to achieve this? Note that I can also make some modifications to the legacy code if needed.