Solved! Go to Solution.
//mxdfolder, mxd are variables for the mxd on the local system; serverFolder is the folder on my ArcGIS Server to publish the mapservice in string pypath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\publisher.py"; ProcessStartInfo psi = new ProcessStartInfo(ConfigurationManager.AppSettings["PythonPath"] + "\\python.exe", pypath + " " + mxdfolder + " " + mxd + " " +serverFolder); psi.UseShellExecute = false; using (Process proc = Process.Start(psi)) { proc.WaitForExit(); }
//mxdfolder, mxd are variables for the mxd on the local system; serverFolder is the folder on my ArcGIS Server to publish the mapservice in string pypath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\publisher.py"; ProcessStartInfo psi = new ProcessStartInfo(ConfigurationManager.AppSettings["PythonPath"] + "\\python.exe", pypath + " " + mxdfolder + " " + mxd + " " +serverFolder); psi.UseShellExecute = false; using (Process proc = Process.Start(psi)) { proc.WaitForExit(); }