使用WinForm来做宿主程序启动ASP Net Core站点:
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "dotnet";
startInfo.Arguments = "xxx.dll";
startInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = true;
System.Diagnostics.Process.Start(startInfo);