Skip to content

Can't export project: System.IO.DirectoryNotFoundException (80070003): Could not find a part of the path #3401

@greenozon

Description

@greenozon

Steps to reproduce

  1. try to save as project

Error message shown

System.AggregateException: One or more errors occurred. (Error decompiling for 'Y-mO-XS/-b8-CQ-QI-WA-Z---.cs') (Error decompiling for '4-q\--oOhy-3-Q\fBe-0G/LG-.cs')
 ---> Error decompiling for 'Y-mO-XS/-b8-CQ-QI-WA-Z---.cs'
in assembly "msa2-cleared-ok1.dll"
 ---> System.IO.DirectoryNotFoundException (80070003): Could not find a part of the path 'c:\Tmp\ILSpy\ICSharpCode.ILSpyCmd\bin\Debug\net8.0\decompiled\Y-mO-XS\-b8-CQ-QI-WA-Z---.cs'.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) in offset 167
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) in of
fset 6
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) in offset
 20
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
 in offset 10
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize) in offset 33
   at System.IO.StreamWriter..ctor(String path) in offset 0
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 281
-- continuing with outer exception (ICSharpCode.Decompiler.DecompilerException) --
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 315
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset
259
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in offset 17
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source) in offset 0
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset
609
   at System.Threading.Tasks.TaskReplicator.Replica.Execute() in offset 35
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStat
eAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStat
eAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 body)
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>g__ProcessFiles|3(List`1 files) in c:\Tmp\ILSpy\ICSharpCode.Decompiler\CShar
p\ProjectDecompiler\WholeProjectDecompiler.cs:line 270
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.WriteCodeFilesInProject(MetadataFile module, IList`1 partialTypes, CancellationToken cancellationToken) in c:\Tmp\ILSpy\ICS
harpCode.Decompiler\CSharp\ProjectDecompiler\WholeProjectDecompiler.cs:line 225
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.DecompileProject(MetadataFile file, String targetDirectory, TextWriter projectFileWriter, CancellationToken cancellationTok
en) in c:\Tmp\ILSpy\ICSharpCode.Decompiler\CSharp\ProjectDecompiler\WholeProjectDecompiler.cs:line 154
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.DecompileAsProject(String assemblyFileName, String projectFileName) in c:\Tmp\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 385
   at ICSharpCode.ILSpyCmd.ILSpyCmdProgram.OnExecuteAsync(CommandLineApplication app) in c:\Tmp\ILSpy\ICSharpCode.ILSpyCmd\IlspyCmdProgram.cs:line 194
 ---> (Inner Exception #1) Error decompiling for '4-q\--oOhy-3-Q\fBe-0G/LG-.cs'

Expectations: assembly saved succeessfully even if it has obfuscated names/etc
sometimes it's usefull to have full sources that is easy to explore/search/etc
file names does not matter...

Note: I believe the issue is inside the following routine:

static string CleanUpName(string text, bool separateAtDots, bool treatAsFileName)

Details

  • c:\Tmp\ILSpy\ICSharpCode.ILSpyCmd\bin\Debug\net8.0>ilspycmd.exe --version
  • ilspycmd: 9.0.0.7899
  • ICSharpCode.Decompiler: 9.0.0.7899

err_save_as_project.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions