Skip to content

Commit

Permalink
fix: Adjust DependenciesInitializer for SourceGenerator and 6.0.200
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jan 31, 2022
1 parent eda724c commit 9070fe3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ internal static void Init()
{
var basePath = Path.GetDirectoryName(baseAnalyzer);

var files = Directory
.EnumerateFiles(basePath, "*.dll")
.Where(f => Path.GetFileName(f).StartsWith("Uno."));
var files = from file in Directory.EnumerateFiles(basePath, "*.dll")
let fileName = Path.GetFileName(file)
where fileName.StartsWith("Uno.")

// Starting from net 6.0.200, avoids "System.IO.FileLoadException: Assembly with same name is already loaded"
where !fileName.Equals(Path.GetFileName(baseAnalyzer), StringComparison.OrdinalIgnoreCase)
select file;

foreach (var file in files)
{
Expand Down

0 comments on commit 9070fe3

Please sign in to comment.