Skip to content

Commit

Permalink
React to nullable changes in Microsoft.Extensions.DependencyModel
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj committed Sep 13, 2021
1 parent 650541a commit e4f19da
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,21 +1016,21 @@ private static Project CreateTestProject(

private class AppLocalResolver : ICompilationAssemblyResolver
{
public bool TryResolveAssemblyPaths(CompilationLibrary library, List<string> assemblies)
public bool TryResolveAssemblyPaths(CompilationLibrary library, List<string>? assemblies)
{
foreach (var assembly in library.Assemblies)
{
var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly));
if (File.Exists(dll))
{
assemblies.Add(dll);
assemblies!.Add(dll);
return true;
}

dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
if (File.Exists(dll))
{
assemblies.Add(dll);
assemblies!.Add(dll);
return true;
}
}
Expand All @@ -1054,7 +1054,7 @@ private static Project CreateBaseProject()
project = project.WithParseOptions(((CSharpParseOptions)project.ParseOptions!).WithLanguageVersion(LanguageVersion.Preview));


foreach (var defaultCompileLibrary in DependencyContext.Load(typeof(RazorSourceGeneratorTests).Assembly).CompileLibraries)
foreach (var defaultCompileLibrary in DependencyContext.Load(typeof(RazorSourceGeneratorTests).Assembly)!.CompileLibraries)
{
foreach (var resolveReferencePath in defaultCompileLibrary.ResolveReferencePaths(new AppLocalResolver()))
{
Expand Down

0 comments on commit e4f19da

Please sign in to comment.