1
I need to start IIS Express via C# with WPF. I can even upload the site and navigate, but only for a few seconds. Logo the site stops responding to requests, and only return reply when I close the application.
private void WinPrincipal_Loaded(object sender, RoutedEventArgs e)
{
IniciarSite();
}
public void IniciarSite()
{
string path = @"C:\Program Files\IIS Express\iisexpress.exe";
string argumentos = @"/path:C:\Sites /port:9090 /systray:true";
if (!File.Exists(path))
throw new FileNotFoundException();
var process = Process.Start(new ProcessStartInfo()
{
FileName = path,
Arguments = argumentos,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
});
}
Initially I thought it was because I was using some unusual doors like 9092, 8082. Then I started testing with the 9090, but it also happens, stops responding and only comes back when you close the application.
I also noticed that when I compile in "debug" the problem happens, but when compiling in "release" works normally.