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

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

Open
dodexahedron opened this issue Jun 13, 2024 · 1 comment

Comments

@dodexahedron
Copy link

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
@dodexahedron
Copy link
Author

Creating an empty file with that name, to avoid that exception, results in the program running without throwing an exception, but the file remains empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant