Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't decompile project with / in resource name on Windows #2830

Closed
WEGFan opened this issue Nov 6, 2022 · 0 comments · Fixed by #2857
Closed

Can't decompile project with / in resource name on Windows #2830

WEGFan opened this issue Nov 6, 2022 · 0 comments · Fixed by #2857
Labels

Comments

@WEGFan
Copy link

WEGFan commented Nov 6, 2022

Steps to reproduce

  1. Download ConsoleApp.zip and load ConsoleApp.exe into ILSpy
  2. Select File | Save Code...

Error message shown

System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Test\test.txt'.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.WriteResourceFilesInProject(PEFile module)+MoveNext() in /_/ICSharpCode.Decompiler/CSharp/ProjectDecompiler/WholeProjectDecompiler.cs:line 371
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.DecompileProject(PEFile moduleDefinition, String targetDirectory, TextWriter projectFileWriter, CancellationToken cancellationToken) in /_/ICSharpCode.Decompiler/CSharp/ProjectDecompiler/WholeProjectDecompiler.cs:line 153
   at ICSharpCode.ILSpy.CSharpLanguage.DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options) in D:\a\ILSpy\ILSpy\ILSpy\Languages\CSharpLanguage.cs:line 411
   at ICSharpCode.ILSpy.TreeNodes.AssemblyTreeNode.Decompile(Language language, ITextOutput output, DecompilationOptions options) in D:\a\ILSpy\ILSpy\ILSpy\TreeNodes\AssemblyTreeNode.cs:line 370
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) in D:\a\ILSpy\ILSpy\ILSpy\TextView\DecompilerTextView.cs:line 917
   at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass64_0.<SaveToDiskAsync>b__0() in D:\a\ILSpy\ILSpy\ILSpy\TextView\DecompilerTextView.cs:line 1121

Details

  • Product in use: ILSpy
  • Version in use:
    • ILSpy version 8.0.0.7187-preview2
    • ILSpy version 7.2.0.6791-preview3
    • ILSpy version 7.2.0.6702-preview2 works fine, the resource file is saved as Test-test.txt
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant