My Google skills are lacking at the moment. When should I be using IIS Express vs. IIS vs. Project vs. Executable? What are the pros/cons of each?
Select the web application project and open properties -> select the web tab -> under server's select IIS express-> Specify the project URL. Now open the project folder and . vs folder (Hidden) -> Config -> applicationhost. config and make required configuration changes as detailed above.
Press the run button on Visual Studio, it will start building the Dot Net Core Web Api project, the Api will be hosted under IIS Express and it will open a local browser with the localhost and some port will be assigned along with the default controller and action and with a Swagger UI.
You can check if you have the module in your IIS Express configuration file %\PROGRAMFILES(x86)%\IIS Express\config\templates\PersonalWebServer\applicationhost. config . If there is at least one of the following lines, then you have the module installed: <add name="AspNetCoreModule"...
dotnet run
from the command line. This is also a very good option for debugging, as you can directly see the logging output. Depending on your target production environment, this might even make more sense than running behind IIS Express.So basically it comes down to IIS Express or Project. These are the two that are also configured properly by default in the launchSettings.json
file that comes with the ASP.NET Core application template.
Whether you prefer IIS Express or running the application directly probably comes down to personal preference. So just give both a try and see what feels nicer to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With