From 6855f589fc359864c4faa9bf3321dea54230bedc Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 5 Dec 2022 22:53:18 +0100 Subject: [PATCH] Fix #2858: Make sure that target directory of DumpPackageAssemblies exists. --- ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs b/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs index 681397143..3437660dd 100644 --- a/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs +++ b/ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs @@ -365,7 +365,9 @@ Examples: contents = decompressedStream; } - using (var fileStream = File.Create(Path.Combine(outputDirectory, entry.RelativePath))) + string target = Path.Combine(outputDirectory, entry.RelativePath); + Directory.CreateDirectory(Path.GetDirectoryName(target)); + using (var fileStream = File.Create(target)) { contents.CopyTo(fileStream); }