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
Describe the bug
When trying to 'watch' the docs, I got a null reference exception.
To Reproduce
Steps to reproduce the behavior:
Create a project using the template
Run the WatchDocs target
Refresh the browser after opening the docs page
Expected behavior
Reload of the page
Screenshots
The cmd line shows:
Hosting environment: Production
Content root path: C:\Development\lab\MiniScaffold\docsTool\bin\Debug\netcoreapp3.1
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Program.WebServer.openBrowser(String url) in C:\Development\lab\MiniScaffold\docsTool\Program.fs:line 510
at [email protected](Unit unitVar) in C:\Development\lab\MiniScaffold\docsTool\Program.fs:line 516
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation1 ctxt, TResult result1, FSharpFunc2 part2) in E:\A_work\130\s\src\fsharp\FSharp.Core\async.fs:line 398
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109 --- End of stack trace from previous location where exception was thrown --- at [email protected](ExceptionDispatchInfo edi) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 907 at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc2 firstAction) in E:\A_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
at Microsoft.FSharp.Control.TrampolineHolder.ExecuteWithTrampoline(FSharpFunc2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 177 at <StartupCode$FSharp-Core>[email protected](Object o) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 165 at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action1 callback, TState& state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
watch : Exited with error code -532462766
watch : Waiting for a file to change before restarting dotnet...
Workaround
Wrapping the below code in a try catch resolves the issue:
let openBrowser url =
//https://github.com/dotnet/corefx/issues/10361
try
let psi = ProcessStartInfo(FileName = url, UseShellExecute = true)
let proc = Process.Start psi
proc.WaitForExit()
if proc.ExitCode <> 0 then failwithf "opening browser failed"
with
| _ -> printfn "cannot open browser"
Desktop (please complete the following information):
.NET Core SDK (reflecting any global.json):
Version: 3.1.102
Commit: 573d158fea
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.102\
Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26
Describe the bug
When trying to 'watch' the docs, I got a null reference exception.
To Reproduce
Steps to reproduce the behavior:
WatchDocs
targetExpected behavior
Reload of the page
Screenshots
The cmd line shows:
Workaround
Wrapping the below code in a try catch resolves the issue:
Desktop (please complete the following information):
.NET Core SDK (reflecting any global.json):
Version: 3.1.102
Commit: 573d158fea
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.102\
Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26
.NET Core SDKs installed:
2.1.801 [C:\Program Files\dotnet\sdk]
2.1.802 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
2.2.402 [C:\Program Files\dotnet\sdk]
3.0.100 [C:\Program Files\dotnet\sdk]
3.1.102 [C:\Program Files\dotnet\sdk]
Smartphone (please complete the following information):
NA
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: