1
votes

We have a web page that uses Process.Start to run msbuild, and we supply it with an msbuild file to process.

The msbuild script contains many normal msbuild tasks, and an Exec task to run hg.exe.

When we tell Process.Start to simply run "msbuild.exe" it works fine. The script is executed, hg.exe is run, everything is fine.

But when we tell Process.Start to run "c:\specific-path-to-4.0\msbuild.exe" it fails. It does try to execute the script, and it does execute some of the tasks, but it fails to run the Exec task that runs hg.exe. It gives an "access denied" error.

The problem is, we have some tasks in there that require 4.0, so we do need to use that version of msbuild.

We have gone around giving priviliges like crazy to exes and paths all to no avail. Any help would be greatly appreciated.

1

1 Answers

2
votes

the problem had something to do with 64bit versus 32bit. while it "runs on my machine!" and on other servers just fine, on some servers we had the problem listed here. All of the test machines were 64 bit, but some had the problem and some did not. in the end, the fix was simple:

we needed to call:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe

instead of calling:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe

we never could figure out what exactly was the cause, or why it worked on some servers but not others. but this simple change works on all of them, so we're happy!

not sure if this is appropriate or not but to give credit where it is due... our fantatical support at Rackspace figured it out for us!