waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.92k stars 113 forks source link

Move .NET Runtime detection so failures don't crash the REPL #277

Closed waf closed 1 year ago

waf commented 1 year ago

See #268, if MSBuildLocator fails to find dotnet, we currently hard crash. MSBuildLocator isn't required for basic REPL usage; it's only used when loading csproj or SLN files into the REPL. Move this so it doesn't crash the REPL, and also add some trace logging for better debugging when this does happen.

codecov[bot] commented 1 year ago

Codecov Report

Merging #277 (e9ae8bd) into main (f3a9741) will increase coverage by 0.0%. The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main    #277   +/-   ##
=====================================
  Coverage   77.5%   77.5%           
=====================================
  Files         81      81           
  Lines       5478    5484    +6     
  Branches     721     720    -1     
=====================================
+ Hits        4248    4254    +6     
  Misses       965     965           
  Partials     265     265           
Impacted Files Coverage Δ
.../MetadataResolvers/SolutionFileMetadataResolver.cs 78.2% <ø> (-2.6%) :arrow_down:
...ces/Roslyn/References/DotNetInstallationLocator.cs 89.2% <100.0%> (+1.3%) :arrow_up:
CSharpRepl.Services/Roslyn/RoslynServices.cs 83.9% <100.0%> (+<0.1%) :arrow_up: