Skip to content

FileNotFoundException when CodeConversion.exe provided with -o argument #13

@dodexahedron

Description

@dodexahedron

Directly invoking the executable, since the script passes the wrong parameters as mentioned in #12, still doesn't work, throwing a FileNotFoundException for the output file:

CodeConversion.exe -i .\MyModule.psm1 -o .\MyModule.cs

results in:

Unhandled exception. System.IO.FileNotFoundException: Could not find file 'V:\MyModule.cs'.
File name: 'V:\MyModule.cs'
   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 System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding)
   at System.IO.File.ReadAllText(String path)
   at CodeConversion.Program.<>c.<Main>b__0_0(Options o) in C:\src\code-conversion\src\Program.cs:line 40
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at CodeConversion.Program.Main(String[] args) in C:\src\code-conversion\src\Program.cs:line 23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions