We just finished figuring out how to work around this problem. We now have watin tests running through CruiseControl.net running as a service.
We need our cc.net service to run as a specific user in order to access the website we are testing due to the way the security is set up. Since the service is running as a domain user the 'Allow user to interact with desktop' checkbox is disabled on the service security tab. We don't want to just run the command process from an always logged in user because we want the process to start automatically on reboot. Now we have figured out
The way we worked around this was by first creating a batch file to call the nunit-console.exe. Parameters to nunit-console.exe are passed to the batch file as parameters which then passes the parameters on. The second, and last, line of the batch file returns the return code returned from nunit-console.exe. The batch file essentially looks like this:
nunit-console.exe %1 %2
exit /b %ERRORLEVEL%
The number of parameters you pass through to nunit-console may be different based on your needs.
We are using nant for our builds, so then we replaced our existing nant task to call nunit-console with an exec task that calls cmd.exe that looks like this:
<exec program="cmd.exe" failonerror="true">
<arg value="/interactive" />
<arg value="/c" />
<arg value="[batch file name]" />
<arg value="[parameter one value]" />
<arg value="[parameter two value" />
</exec>
I don't know what the same task would look like in msbuild but I'm sure you can look it up. The ultimate result is essentially a command that looks like this:
cmd.exe /interactive /c [batch file name] [parameter one value] [parameter two value]
Alternatively, you could use nant and just create msbuld nant tasks to call your existing builds.
The '/interactive' parameter to cmd.exe is the key, it runs the batch file on a process that has permission to interact with the desktop. I'm actually not positive if the '/c' parameter is required, but it is working as it is. We are still telling nunit to log the results to the same xml file so our merge task didn't need to change and the reporting of the test results to cruise control is working great.