diff --git a/ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj b/ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
index cfbb05b50..bf430983a 100644
--- a/ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
+++ b/ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
@@ -49,7 +49,8 @@
-
+
+
diff --git a/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs b/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
index 6fe688dea..50770a98f 100644
--- a/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
+++ b/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
@@ -22,6 +22,8 @@ using ICSharpCode.ILSpyX.PdbProvider;
using McMaster.Extensions.CommandLineUtils;
+using Microsoft.Extensions.Hosting;
+
namespace ICSharpCode.ILSpyCmd
{
[Command(Name = "ilspycmd", Description = "dotnet tool for decompiling .NET assemblies and generating portable PDBs",
@@ -49,7 +51,7 @@ Examples:
MemberName = nameof(DecompilerVersion))]
class ILSpyCmdProgram
{
- public static Task Main(string[] args) => CommandLineApplication.ExecuteAsync(args);
+ public static Task Main(string[] args) => new HostBuilder().RunCommandLineApplicationAsync(args);
[FilesExist]
[Required]
@@ -107,6 +109,12 @@ Examples:
[Option("--nested-directories", "Use nested directories for namespaces.", CommandOptionType.NoValue)]
public bool NestedDirectories { get; }
+ private readonly IHostEnvironment _env;
+ public ILSpyCmdProgram(IHostEnvironment env)
+ {
+ _env = env;
+ }
+
private Task OnExecuteAsync(CommandLineApplication app)
{
TextWriter output = System.Console.Out;