For different deployment environments, we want to either publish our application via IIS, or via Windows Service.
From this thread we learned that we have to remove the other UseABC()
option from Program.cs -> CreateHostBuilder() -> ConfigureWebHostDefaults()
.
Just to be clear: either UseIIS()
or UseKestrel()
should be enabled there (in fact, last one wins, but this is not the point).
Is this it?
Is there no better option than to create two different deployment packages?
Ideally, there would be one set of binaries that supports both, IIS and Windows Service as hosting environment. Any ideas?
Using .ConfigureKestrel()
instead of UseKestrel()
solved the issue!
Reference: https://stackoverflow.com/a/63505860/2477582
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.