ScottKane / Commander

0 stars 0 forks source link

Unable to load DLL error #2

Open jackchristel opened 1 year ago

jackchristel commented 1 year ago

So I tried running, commander install 258550 -u anonymous -s ./ and I get the error below. System.DllNotFoundException: Unable to load DLL 'os64\conpty.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)

Full Error: System.DllNotFoundException: Unable to load DLL 'os64\conpty.dll' or one of its dependencies: The specified module could not be found. (0x8007007E) at Pty.Net.Windows.NativeMethods.CreatePseudoConsole64(Coord coord, IntPtr input, IntPtr output, UInt32 flags, IntPtr& consoleHandle) at Pty.Net.Windows.NativeMethods.CreatePseudoConsole(Coord coord, IntPtr input, IntPtr output, UInt32 flags, IntPtr& consoleHandle) at Pty.Net.Windows.PtyProvider.StartPseudoConsoleAsync(PtyOptions options, TraceSource trace, CancellationToken cancellationToken) at Pty.Net.Windows.PtyProvider.StartTerminalAsync(PtyOptions options, TraceSource trace, CancellationToken cancellationToken) at Pty.Net.PtyProvider.SpawnAsync(PtyOptions options, CancellationToken cancellationToken) at Commander.Commands.SteamCmdCommand.ExecuteAsync(IConsole console) at Commander.Commands.InstallCommand.ExecuteAsync(IConsole console) at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in D:\a\CliFx\CliFx\CliFx\CliApplication.cs:147 at CliFx.CliApplication.RunAsync(IReadOnlyList1 commandLineArguments, IReadOnlyDictionary2 environmentVariables) in D:\a\CliFx\CliFx\CliFx\CliApplication.cs:191 Seems it has something to do with pty.net but I'm not sure if I'm the only one experiencing an issue like this.

ScottKane commented 1 year ago

Pty.Net is located in https://github.com/ScottKane/Commander/tree/master/Commander/lib, I would make sure in your IDE it's set to copy to output on build. I can't remember why the dll is bundled directly instead of through nuget at this point as it's been a while since I touched this project. Possibly could migrate to pulling it in as a PackageReference but there was likely some version compatibility issues and that was why I bundled the dll directly.

jackchristel commented 1 year ago

I changed it to copy to build, it copies to the build folder, then I do the same thing that made the error happen and it happens again.

ScottKane commented 1 year ago

Are you running on Windows? If not that might explain it

jackchristel commented 1 year ago

I am running it on the latest version of Windows 11 and using Visual Studio 2022 as my IDE.

ScottKane commented 1 year ago

Change Commander.csproj <RuntimeIdentifier>linux-x64</RuntimeIdentifier> to <RuntimeIdentifier>win-x64</RuntimeIdentifier>. This was originally made to be used in docker so the RID was set to linux

ScottKane commented 1 year ago

Oh wait I already changed that in the repo, I just fresh cloned and ran and it works fine for me

jackchristel commented 1 year ago

Interesting, are you using Windows 11 aswell?

ScottKane commented 1 year ago

Yes I am using Windows 11, I have just quickly updated things to use con-pty instead: https://github.com/ScottKane/Commander/tree/con-pty

ScottKane commented 1 year ago

again this is designed to work inside docker as I don't have steamcmd on my local machine as I didn't want to spam install game servers during testing, you should just be able to run commander install 258550, the format of the output is a bit scuffed since switching to con-pty so I would look at the commented out code for how I buffered this in the past so that you can get a tidier output. The idea was to get just the progress number during an installation and use the shell progress bar examples to convert that incoming number into the percentage completion of the progress bar

ScottKane commented 1 year ago

Package repo can be found here: https://github.com/WindowsGSM/SteamCMD.ConPTY

jackchristel commented 1 year ago

Oh thanks. I didn't even realize WindowsGSM already had something like that. I appreciate the help.