Browse Source

Fix obvious .Result errors (there are more instances of calling .Result that would need investigation)

pull/1725/head
Christoph Wille 6 years ago
parent
commit
ba22906b3b
  1. 4
      ILSpy/App.xaml.cs
  2. 2
      ILSpy/LoadedAssembly.cs

4
ILSpy/App.xaml.cs

@ -94,7 +94,7 @@ namespace ICSharpCode.ILSpy @@ -94,7 +94,7 @@ namespace ICSharpCode.ILSpy
var name = Path.GetFileNameWithoutExtension(plugin);
try {
var asm = Assembly.Load(name);
var parts = discovery.CreatePartsAsync(asm).Result;
var parts = discovery.CreatePartsAsync(asm).GetAwaiter().GetResult();
catalog = catalog.AddParts(parts);
} catch (Exception ex) {
StartupExceptions.Add(new ExceptionData { Exception = ex, PluginName = name });
@ -102,7 +102,7 @@ namespace ICSharpCode.ILSpy @@ -102,7 +102,7 @@ namespace ICSharpCode.ILSpy
}
}
// Add the built-in parts
catalog = catalog.AddParts(discovery.CreatePartsAsync(Assembly.GetExecutingAssembly()).Result);
catalog = catalog.AddParts(discovery.CreatePartsAsync(Assembly.GetExecutingAssembly()).GetAwaiter().GetResult());
// If/When the project switches to .NET Standard/Core, this will be needed to allow metadata interfaces (as opposed
// to metadata classes). When running on .NET Framework, it's automatic.
// catalog.WithDesktopSupport();

2
ILSpy/LoadedAssembly.cs

@ -87,7 +87,7 @@ namespace ICSharpCode.ILSpy @@ -87,7 +87,7 @@ namespace ICSharpCode.ILSpy
public PEFile GetPEFileOrNull()
{
try {
return GetPEFileAsync().Result;
return GetPEFileAsync().GetAwaiter().GetResult();
} catch (Exception ex) {
System.Diagnostics.Trace.TraceError(ex.ToString());
return null;

Loading…
Cancel
Save