webworm webworm - 1 year ago 96
ASP.NET (C#) Question

Host a Web API under a Web Forms project

I have a ASP.NET Web APi project that uses an AngularJS as the front end. It is called "MyApiApp".

http://localhost/MyApiApp


I would like to move this project under another project that is an ASP.NET web forms website. It is called "MyWebForms" app.

http://localhost/MyWebFormsApp


My goal is to move the "MyApiApp" under the Web Forms app and access the "MyApiApp" as

http://localhost/MyWebFormsApp/MyApiApp


Is it possible to have an ASP.NET Web API hosted under an ASP.NET Web Forms project? I would like to be able to do this in Visual Studio where I could run that Web Forms application but have access to the "MyApiApp" app via the above URL.

Tim Tim
Answer Source

Yes. You should be able to set it up as a virtual folder in IIS underneath the main website.