Lets take scenario, I developed web application (ASP.NET MVC) which shows list of .xml
files and we select two .xml
files for comparison and use a comparing utility like Beyond Compare 3.
Basically, I have Scrapt file (Beyond Compare 3 Script) which runs on System.Diagnostic.Process
and generates difference report files against the script. I want to use the script in a process which shows a runtime generated difference report. When I run the application from Visual Studio it runs perfectly and shows the expected difference file, but when I deploy this application on my IIS Webserver then it does not generate the difference file and simply shows input file as the output file.
Following is the method which starts the process and generates the Beyond Compare result file as a output file. But following code is running on Visual Studio Development server but it doesn't work on IIS (website deploy on IIS Server).
public string GenerateSortedXMLFile(string inputfilepath)
{
string outputfile, inputfile, BCompare, Script;
inputfile = inputfilepath;
outputfile = ConfigurationManager.AppSettings["MFxmlSortFilePath"];
outputfile = outputfile + System.Guid.NewGuid().ToString() + ".txt";
BCompare = ConfigurationManager.AppSettings["BCompareExe"];
Script = ConfigurationManager.AppSettings["Script"];
Process p = new Process
{
StartInfo =
{
FileName = "\"" + BCompare + "\"",
Arguments = " " + "\"" + "@" + Script + "\"" + " " + "\"" + inputfile + "\"" + " " + "\"" + outputfile + "\" /grant BUILTIN\\Users:IIS_IUSRS"
}
};
p.Start();
p.WaitForExit();
p.Close();
return outputfile;
}