提交 82b67396 编写于 作者: T Tomas Matousek

Fix AppDomain creation utility to apply binding redirects in the created domain.

上级 a9e8f824
......@@ -180,6 +180,7 @@ public void TestLoadErrors3()
public void TestAnalyzerLoading()
{
var dir = Temp.CreateDirectory();
dir.CopyFile(typeof(AppDomainUtils).Assembly.Location);
var test = dir.CopyFile(typeof(FromFileLoader).Assembly.Location);
var analyzerFile = TestHelpers.CreateCSharpAnalyzerAssemblyWithTestAnalyzer(dir, "MyAnalyzer");
var loadDomain = AppDomainUtils.Create("AnalyzerTestDomain", basePath: dir.Path);
......@@ -216,12 +217,12 @@ public class TestAnalyzer : DiagnosticAnalyzer
var dir = Temp.CreateDirectory();
var metadata = dir.CopyFile(typeof(System.Reflection.Metadata.MetadataReader).Assembly.Location);
dir.CopyFile(typeof(System.Reflection.Metadata.MetadataReader).Assembly.Location);
dir.CopyFile(typeof(AppDomainUtils).Assembly.Location);
var immutable = dir.CopyFile(typeof(ImmutableArray).Assembly.Location);
var analyzer = dir.CopyFile(typeof(DiagnosticAnalyzer).Assembly.Location);
var test = dir.CopyFile(typeof(FromFileLoader).Assembly.Location);
var filesystem = dir.CreateFile("System.IO.FileSystem.dll").WriteAllBytes(
TestResources.NetFX.v4_6_1038_0.Facades.System_IO_FileSystem);
dir.CopyFile(Path.Combine(Path.GetDirectoryName(typeof(CSharp.CSharpCompilation).Assembly.Location), "System.IO.FileSystem.dll"));
var analyzerCompilation = CSharp.CSharpCompilation.Create(
"MyAnalyzer",
......
......@@ -25,12 +25,11 @@ public static AppDomain Create(string name = null, string basePath = null)
}
}
return AppDomain.CreateDomain(
name,
null,
appBasePath: basePath,
appRelativeSearchPath: null,
shadowCopyFiles: false);
return AppDomain.CreateDomain(name, null, new AppDomainSetup()
{
ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
ApplicationBase = basePath
});
}
/// <summary>
......
......@@ -110,11 +110,10 @@ public class TestAnalyzer : DiagnosticAnalyzer
public override void Initialize(AnalysisContext context) { throw new NotImplementedException(); }
}";
var metadata = dir.CopyFile(typeof(System.Reflection.Metadata.MetadataReader).Assembly.Location);
dir.CopyFile(typeof(System.Reflection.Metadata.MetadataReader).Assembly.Location);
var immutable = dir.CopyFile(typeof(ImmutableArray).Assembly.Location);
var analyzer = dir.CopyFile(typeof(DiagnosticAnalyzer).Assembly.Location);
var filesystem = dir.CreateFile("System.IO.FileSystem.dll").WriteAllBytes(
TestResources.NetFX.v4_6_1038_0.Facades.System_IO_FileSystem);
dir.CopyFile(Path.Combine(Path.GetDirectoryName(typeof(CSharpCompilation).Assembly.Location), "System.IO.FileSystem.dll"));
var analyzerCompilation = CSharpCompilation.Create(
assemblyName,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册