3

I created a .NET Core 2.2 web application project in VS 2017 and the ASP.NET Core Web Server option from the console output is not visible when the application runs with IIS Express.

By .NET Core 2.1 web application projects this option is there and it is showing the output without any problems.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Stam
  • 2,410
  • 6
  • 32
  • 58
  • Might be related to https://weblog.west-wind.com/posts/2018/Dec/31/Dont-let-ASPNET-Core-Default-Console-Logging-Slow-your-App-down – Lex Li Apr 13 '19 at 15:18
  • @LexLi not sure about this. The problem is that I don not have any output at all. – Stam Apr 13 '19 at 16:31
  • 1
    try the solution here https://stackoverflow.com/questions/40148660/how-to-get-a-console-output-in-asp-net-core-with-iis-express – Mustafa Saeed Apr 13 '19 at 16:33
  • Show some screen shots to tell what exactly you are looking for. – Lex Li Apr 13 '19 at 16:44
  • @MustafaSaeed not the solution but the comment of Ilya Chernomordik was very helpful. Indeed I had to select the start up project in the profile instead of IIS Express and the I could see the logs. – Stam Apr 13 '19 at 17:27
  • @Stam happy to help! :) – Mustafa Saeed Apr 13 '19 at 17:28
  • I am not seeing the console. Chose the profile as Stam says above. I really want to see this as it helps immensely. – Daniel Williams Dec 22 '19 at 05:33

2 Answers2

3

I think you have to right-click on Project->Properties. Then on the right side menu to select "Debug". In Web Server Settings find "Hosting Model" and select "Out of process"enter image description here

Tuvia Khusid
  • 792
  • 5
  • 15
  • 31
1

The simplest option is to change your currently selected debugger run option (the dropdown with the green "play" button / F5) from IIS, to the name of your project (e.g. so that "FooWebApp" shows up now in the dropdown). This way the browser will still open like it was before, but the console window will start showing as well.

On the other route with Tuvia's answer above (thanks!), it's actually Properties/launchSettings.json which stores / determines these actions. There you can also set "launchBrowser": false if wanted, or if you want to change if the console window opens, within "IIS Express" profile, manually add: "ancmHostingModel": "OutOfProcess" (or else set to InProcess).

Nicholas Petersen
  • 9,104
  • 7
  • 59
  • 69