Click here to Skip to main content
15,882,552 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have two projects that I need to link together if possible. I've got a C# Windows Form that runs a load of functions. I also have an ASP.NET web page which gives some similar functionalities via a web page. At the moment, they are separate. What I'd like to do is have the Windows App host the web services to run the ASP.NET pages so it then becomes an all in one application. Has anyone got any links on where to start with this please?

What I have tried:

Everything has been coded in Visual Studio. I have tried Googling what I'm after, but can't find exactly what I need.
Updated 6-Nov-23 1:09am

You don't host the web service in a Windows Forms app.

The normal way to do this would be to have all the functionality exposed and processed by the web service and just rewrite your Forms app to pass data to and call the web service.

Or is there something you've left out of the question that would change that?
Share this answer
If you want to include a web project within a WinForms application, then traditionally that is not possible, as pointed out by Dave. What you can do is use a WebBrowser control pointed at your website.

However, it is possible to create a Hybrid app to host a Blazor WebAssembly app in a WinForms app. More information here: Build a Windows Forms Blazor app | Microsoft Learn[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900