Browse Source

Fix missing AssemblyResolver in ILSpyWholeProjectDecompiler.

pull/1030/head
Siegfried Pammer 7 years ago
parent
commit
41e43920dc
  1. 4
      ICSharpCode.Decompiler/CSharp/WholeProjectDecompiler.cs
  2. 1
      ILSpy/Languages/CSharpLanguage.cs

4
ICSharpCode.Decompiler/CSharp/WholeProjectDecompiler.cs

@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.CSharp
/// </remarks> /// </remarks>
protected string targetDirectory; protected string targetDirectory;
public void DecompileProject(Metadata.PEFile moduleDefinition, string targetDirectory, CancellationToken cancellationToken = default(CancellationToken)) public void DecompileProject(PEFile moduleDefinition, string targetDirectory, CancellationToken cancellationToken = default(CancellationToken))
{ {
string projectFileName = Path.Combine(targetDirectory, CleanUpFileName(moduleDefinition.Name) + ".csproj"); string projectFileName = Path.Combine(targetDirectory, CleanUpFileName(moduleDefinition.Name) + ".csproj");
using (var writer = new StreamWriter(projectFileName)) { using (var writer = new StreamWriter(projectFileName)) {
@ -88,7 +88,7 @@ namespace ICSharpCode.Decompiler.CSharp
} }
} }
public void DecompileProject(Metadata.PEFile moduleDefinition, string targetDirectory, TextWriter projectFileWriter, CancellationToken cancellationToken = default(CancellationToken)) public void DecompileProject(PEFile moduleDefinition, string targetDirectory, TextWriter projectFileWriter, CancellationToken cancellationToken = default(CancellationToken))
{ {
if (string.IsNullOrEmpty(targetDirectory)) { if (string.IsNullOrEmpty(targetDirectory)) {
throw new InvalidOperationException("Must set TargetDirectory"); throw new InvalidOperationException("Must set TargetDirectory");

1
ILSpy/Languages/CSharpLanguage.cs

@ -380,6 +380,7 @@ namespace ICSharpCode.ILSpy
this.assembly = assembly; this.assembly = assembly;
this.options = options; this.options = options;
base.Settings = options.DecompilerSettings; base.Settings = options.DecompilerSettings;
base.AssemblyResolver = assembly.GetAssemblyResolver();
} }
protected override IEnumerable<Tuple<string, string>> WriteResourceToFile(string fileName, string resourceName, Stream entryStream) protected override IEnumerable<Tuple<string, string>> WriteResourceToFile(string fileName, string resourceName, Stream entryStream)

Loading…
Cancel
Save