You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'dotnet watch run' does not work if Serilog is started in CreateHostBuilder with UseSerilog function. Dotnet is building a project but not starting browser.
Probably, the problem is that by default Serilog does not write to Asp.Net Core logging providers. But after adding to UseSerilog a parameter 'writeToProviders' with a value of 'true', dotnet writes error in the console:
watch : Unable to launch browser: System.ComponentModel.Win32Exception (2): .
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.DotNet.Watcher.Tools.LaunchBrowserFilter.LaunchBrowser(String launchUrl)
at Microsoft.DotNet.Watcher.Tools.LaunchBrowserFilter.OnOutput(Object sender, DataReceivedEventArgs eventArgs)
Serilog is quite popular and it would be good to find a way to use it in Asp.Net Core project without any problems.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
'dotnet watch run' does not work if Serilog is started in CreateHostBuilder with UseSerilog function. Dotnet is building a project but not starting browser.
Probably, the problem is that by default Serilog does not write to Asp.Net Core logging providers. But after adding to UseSerilog a parameter 'writeToProviders' with a value of 'true', dotnet writes error in the console:
watch : Unable to launch browser: System.ComponentModel.Win32Exception (2): .
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.DotNet.Watcher.Tools.LaunchBrowserFilter.LaunchBrowser(String launchUrl)
at Microsoft.DotNet.Watcher.Tools.LaunchBrowserFilter.OnOutput(Object sender, DataReceivedEventArgs eventArgs)
Serilog is quite popular and it would be good to find a way to use it in Asp.Net Core project without any problems.
Beta Was this translation helpful? Give feedback.
All reactions