Closed tiandian closed 5 years ago
TestServer is good for this. It lets you send request to the web app in memory rather than over the network.
Your alternative is to use IWebHost.Start()
rather than Run()
. Run calls Start and then blocks until CTL+C is pressed. Start doesn't block.
@Tratcher, i have test TestServer, it is just what i want! Thank you!
Is your feature request related to a problem? Please describe.
I am trying to use CefGlue or Chromely or CefSharp to combine asp.net core to develop a cross platform desktop app, but after asp.net core run, it need listen the http(s) port, and it will occupies the main thread's message loop, so it need run in a standalone process, it is not so good for a desktop app.
Describe the solution you'd like
above is the current asp.net core code, after host.run(), it will occupies main thread's message loop, it is not good for a desktop app, i hope i can do as below:
So all i need is IWebHost add a ProcessRequest method.
Additional context
There are other way to develop a desktop use asp.net core, like Electron.NET , but it let asp.net core run in a standalone process, and it is not eay to write code/debug/publish, if asp.net core can run with CefGlue /Chromely in the same process/project, it will be more easy to develop cross platform desktop apps.
thanks!