I'm making a console window that runs a game server and I'd like to add commands for various things. Since commands will require parameters I've decided to use the ManyConsole nuGet.
I've made an test project and have added the built .dll to my server's list of references but am having difficulty figuring out how to send input to the text project .dll.
I've never used PowerShell before to launch applications but I was able to run the ServerCommands project on it without issue, and it's got me thinking maybe I should just built the whole server to be run through PowerShell, the whole thing is static anyway.
ServerCommands.dll
public class Program
{
public static int Main( string[] args )
{
var commands = GetCommands();
return ConsoleCommandDispatcher.DispatchCommand( commands, args, Console.Out );
}
public static IEnumerable<ConsoleCommand> GetCommands()
{
return ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs( typeof( Program ) );
}
}
Server
internal class Program
{
private static void Main( string[] args )
{
string[] t = new string[1] { "test" };
ServerCommands.Program.Main( t );
}
}
returns error: System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'