简体   繁体   中英

Web APIs in Desktop application

I have a desktop application built using .NET Framework 4.7.2. Now I have a requirement to build a rest API layer with it using which the functionality of the desktop application can be tested with other test tools I have.

So I need to start a web API on demand. Is there any way to start and stop a web API on-demand in .NET Framework 4.7.2?

The key word to look for in this context is "self-hosting". This means that your process hosts a HTTP server that can be accessed from clients - eg a test tool as in your case.

This documentation shows a sample that uses ASP.NET 4.x.

In order to only start the server when needed, you could add a configuration setting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM