I am trying to execute MSdeploy.exe using c# dotnet and while I run the code I am getting an exception under main module saying A 32 bit processes cannot access modules of a 64 bit process.
below is the code :
string temp = @"C:\Projects\AUTODEPLOY\IIS\AppUAT";
string sourcePackageLocation = @"C:\Projects\AUTODEPLOY\SERVERS\UAT\WATCH\Test.zip";
ProcessStartInfo startInfo = new ProcessStartInfo();
// Use ProcessStartInfo class
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = msDeployPath;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "-verb:sync -source:contentPath=" + temp + " -dest:package:" + sourcePackageLocation + "";
try
{
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
exitCode = exeProcess.ExitCode;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine("Deploy Failed");
}
The error occurs is :
{"A 32 bit processes cannot access modules of a 64 bit process."} System.Runtime.InteropServices.ExternalException {System.ComponentModel.Win32Exception}
Native code 299
Can anyone please help me out to understand the problem?