The output of the web application is no longer visible in the output of visual studio (ASP.NET Core Web Server) when using InProcess IIS hosting (webapp.csproj =>
Steps to reproduce the behavior:
The ASP.NET Core Web Server output should be available and we should see the output log of the web app
I am using asp.net core 2.2.1
If I change the value of AspNetCoreHostingModel to OutOfProcess, everything works as expected
Can you check the Output window "Show output from: Debug"?
yes that works when you start debugging the web application. Thanks for that workaround. But this doesn't work when not in debug as it used to when using outofprocess...
@BillHiebert @vijayrkn Thoughts on this?
@muratg whenrun out of process, Visual Studio inserts a "shim" process between IIS and the users application, The shim starts the user process, connects to stderr\stdout and redirects it to a pipe opened by VS. Inprocess does not have the shim process so it doesn't pick up up the outputs. Since we start the IIS Express process, we could look into grabbing its output and showing it in the window..
I think piping the output of iisexpress would just "work". We do it in functional tests today.
Out of curiosity, is this issue gonna be resolved in the upcomming asp.net core 3 release?
It is fixed in the next preview of VS 2019.
What about VS2017? 馃槙
EDIT:
Found a workaround:
https://www.nuget.org/packages/Serilog.Sinks.Debug/
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.Debug()
.CreateLogger();
I tried it again today with visual studio 2019 16.0.3 and it only shows:
Request started: "Get" ...
andRequest ended: ...
I tried to add the serilog.sinks.debug without any success.
@yepeekai still not working with 16.1.5
As a workaround you can modify the project properties, navigate to Debug
, select the 脤IS Express
profile and select Out Of Process
as hosting model. It's a change that is local for your machine so you will be still running InProcess in production.
@BillHiebert Still not fixed in VS 2019 16.1.6. This is a bit of a drag on debugging if InProcess is specifically required (Debug is a workaround). Any thoughts on resolution?
@fragilerus this should be working in that build. I assume you are using IIS Express for hosting?
@BillHiebert I believe this is still an issue with 2.2. I have a proposed fix here: https://github.com/aspnet/AspNetCore/pull/10084, but we haven't patched it yet.
This, however, does work in 3.0.
3.0 is out and we updated to it and it works.
Most helpful comment
@yepeekai still not working with 16.1.5
As a workaround you can modify the project properties, navigate to
Debug
, select the脤IS Express
profile and selectOut Of Process
as hosting model. It's a change that is local for your machine so you will be still running InProcess in production.