I want to generate "service-worker.js" using sw-precache
from command line (cmd.exe) I run this command and output is :
Total precache size is about 145 kB for 35 resources. service-worker.js has been generated with the service worker contents.
When I run this command from C# output is empty, here is my code:
Process proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = @"cmd.exe",
Arguments = @"/c sw-precache",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
WorkingDirectory = Path.GetFullPath(myDir)
}
};
proc.Start();
proc.WaitForExit();
string output = proc.StandardOutput.ReadToEnd();
If I run command like "dir" in Arguments = @"/c dir", output contains message from dir command,
what I do wrong?
Edit: In Console Application, output is returned normally, but not in Web Application