I'm trying to set up NCrunch with my TeamCity server. My build agent is running under the Local System account, which seems to cause problems for NCrunch.
Running the NCrunch Console Tool from a command line as a normal user works fine. My solution compiles and all tests are run successfully.
Running the NCrunch Console Tool from a command line as Local System gives an error
Quote:[10:38:58.2328-LocalBuildTask-5] ERROR (Build): NCrunchTest: (0): NCrunch was unable to parse this project file because of an unexpected error: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\AppData\Local\NCrunch\2588\1\NCrunchTest'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.SetCurrentDirectory(String path)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
Examining the detailed log, we can see that files are in fact being copied to this directory, so it seems to exist. Some examples of successful events
Quote:[10:38:57.9431-LocalBuildTask-5] Building new workspace C:\Windows\system32\config\systemprofile\AppData\Local\NCrunch\2588\1 for component NCrunchTest in context of grid client (local)
[10:38:57.963-LocalBuildTask-5] Writing new workspace member C:\Windows\system32\config\systemprofile\AppData\Local\NCrunch\2588\1\NCrunchTest\Properties\AssemblyInfo.cs (version 1)
[10:38:57.983-LocalBuildTask-5] Copying assembly reference C:\Users\coll-loans-bld\Desktop\NCrunchTest\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll into workspace at C:\Windows\system32\config\systemprofile\AppData\Local\NCrunch\2588\1\_ncrunchreferences\xunit.abstractions.dll (BCL=False)
Please see provided log file.
https://www.dropbox.com/...h-detailed-log.txt?dl=0
Windows Server 2012 R2 Datacenter
NCrunch Console Tool 2.17.0.16
Any idea what the problem might be? Is it related to permissions? Is the folder path simply too long? Is it possible to reconfigure NCrunch to store its workspace somewhere else?
(Not sure how to open a command prompt under Local System? Just download Sysinternals and run "psexec -s cmd" in an elevated prompt.)