Skip to content

Commit a222250

Browse files
Provide correct Microsoft.VisualBasic assemblies for each version of .NET
1 parent 04348b3 commit a222250

File tree

1 file changed

+9
-4
lines changed
  • ICSharpCode.Decompiler.Tests/Helpers

1 file changed

+9
-4
lines changed

ICSharpCode.Decompiler.Tests/Helpers/Tester.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,21 @@ public static async Task<CompilerResults> CompileCSharp(string sourceFileName, C
524524
libPath = "\"" + refAsmPath + "\"";
525525
references = references.Select(r => "-r:\"" + Path.Combine(refAsmPath, r) + "\"");
526526
sourceFileNames.Add(targetFrameworkAttributeSnippetFiles[targetFramework].Value);
527+
if (flags.HasFlag(CompilerOptions.ReferenceVisualBasic))
528+
{
529+
references = references.Concat(new[] { "-r:\"" + Path.Combine(refAsmPath, "Microsoft.VisualBasic.dll") + "\"" });
530+
references = references.Concat(new[] { "-r:\"" + Path.Combine(refAsmPath, "Microsoft.VisualBasic.Core.dll") + "\"" });
531+
}
527532
}
528533
else
529534
{
530535
refAsmPath = RefAssembliesToolset.GetPath("legacy");
531536
libPath = "\"" + refAsmPath + "\"";
532537
references = defaultReferences.Select(r => "-r:\"" + Path.Combine(refAsmPath, r) + "\"");
533-
}
534-
if (flags.HasFlag(CompilerOptions.ReferenceVisualBasic))
535-
{
536-
references = references.Concat(new[] { "-r:\"" + Path.Combine(refAsmPath, "Microsoft.VisualBasic.dll") + "\"" });
538+
if (flags.HasFlag(CompilerOptions.ReferenceVisualBasic))
539+
{
540+
references = references.Concat(new[] { "-r:\"" + Path.Combine(refAsmPath, "Microsoft.VisualBasic.dll") + "\"" });
541+
}
537542
}
538543
if (useRoslyn && !targetNet40 && flags.HasFlag(CompilerOptions.ReferenceUnsafe))
539544
{

0 commit comments

Comments
 (0)