Skip to content

Commit d732d86

Browse files
authored
Fix issue with MSBuildAssemblyResolver (#19)
Resolve any assembly that matches full name in the MSBuild directory
1 parent ebb32d9 commit d732d86

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/MSBuildProjectCreator/MSBuildAssemblyResolver.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,14 @@ public static Assembly AssemblyResolve(object sender, ResolveEventArgs args)
6363
{
6464
AssemblyName assemblyName = new AssemblyName(args.Name);
6565

66-
if (!assemblyName.Name.StartsWith("Microsoft.Build") || !MicrosoftPublicKeyToken.SequenceEqual(assemblyName.GetPublicKeyToken()) || String.IsNullOrWhiteSpace(MSBuildDirectoryLazy.Value))
67-
{
68-
return null;
69-
}
70-
7166
FileInfo fileInfo = new FileInfo(Path.Combine(MSBuildDirectoryLazy.Value, $"{assemblyName.Name}.dll"));
7267

7368
if (!fileInfo.Exists)
7469
{
7570
return null;
7671
}
7772

78-
return Assembly.LoadFrom(fileInfo.FullName);
73+
return !assemblyName.FullName.Equals(AssemblyName.GetAssemblyName(fileInfo.FullName).FullName) ? null : Assembly.LoadFrom(fileInfo.FullName);
7974
}
8075
}
8176
}

0 commit comments

Comments
 (0)