Generate binding redirect for Desktop CLR
This commit is contained in:
parent
f089fff7fa
commit
d09137f8d5
3 changed files with 230 additions and 0 deletions
|
@ -496,6 +496,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
|||
{
|
||||
CopyExport(outputPath, export);
|
||||
}
|
||||
GenerateBindingRedirects(runtimeContext, outputPath, exporter);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -503,6 +504,17 @@ namespace Microsoft.DotNet.Tools.Compiler
|
|||
}
|
||||
}
|
||||
|
||||
private static void GenerateBindingRedirects(ProjectContext runtimeContext, string outputPath, LibraryExporter exporter)
|
||||
{
|
||||
var generator = new BindingRedirectGenerator();
|
||||
var config = generator.Generate(exporter.GetAllExports());
|
||||
var path = Path.Combine(outputPath, runtimeContext.ProjectFile.Name + ".exe.config");
|
||||
using (var stream = File.Create(path))
|
||||
{
|
||||
config.Save(stream);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopyExport(string outputPath, LibraryExport export)
|
||||
{
|
||||
CopyFiles(export.RuntimeAssemblies, outputPath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue