Hi all,
I'm trying to set up an Environment variable as the solution's NCrunch Cache Storage Path, but I'm not able to do it.
I'm following:
https://www.ncrunch.net/documentation/reference_solution-configuration_ncrunch-cache-storage-path
When setting the value:
<NCrunchCacheStoragePath>%MyNCrunchPath%\project1</NCrunchCacheStoragePath>
NCrunch is showing an error:
NCrunch was unable to access the directory 'C:\src\projects\project1\%MyNCrunchPath%\project1' as specified in the configuration for this solution. Cache data will instead be stored in the default location.
It doesn't seem to like the env variable. I'm using NCrunch 2.27.0.3 so it should be supported.
Any tip would help.
Thanks!
Remco NCrunch Developer
#9359
02 Nov 2016 11:14 UTC
Hi,
Thanks for sharing this issue.
I'm having difficulty reproducing this problem ... when I create an environment variable and set it up in the same manner as you've done, NCrunch v2.27.0.3 seems to create the storage directory and use it as expected.
Are you certain the environment variable has been properly added to your system settings? Note that if you add the environment variable after launching Visual Studio, it won't be present for NCrunch until VS has been restarted.
Thanks for sharing this issue.
I'm having difficulty reproducing this problem ... when I create an environment variable and set it up in the same manner as you've done, NCrunch v2.27.0.3 seems to create the storage directory and use it as expected.
Are you certain the environment variable has been properly added to your system settings? Note that if you add the environment variable after launching Visual Studio, it won't be present for NCrunch until VS has been restarted.
[v3.6.0.2]
I use below in my NCrunch console config file:
but only WorkspaceBasePath setting seems to be respected. If I hardcode the cache storage path, it works as expected.
I use below in my NCrunch console config file:
<NCrunchCacheStoragePath>%NCrunchConsoleCacheStoragePath%</NCrunchCacheStoragePath>
<WorkspaceBasePath>%NCrunchConsoleWorkspaceBasePath%</WorkspaceBasePath>
but only WorkspaceBasePath setting seems to be respected. If I hardcode the cache storage path, it works as expected.
Edited 22 Mar 2017 11:55 UTC
Remco NCrunch Developer
#10083
22 Mar 2017 12:08 UTC
Do you see NCrunch give any errors in its log when it attempts to load from this configuration file? This setting is being passed through a method to resolve environment variables, so something must be amiss. Are you able to share the value of this environment variable as this exists on your machine?
Remco wrote:Do you see NCrunch give any errors in its log when it attempts to load from this configuration file?
No (but I see it uses the workspace setting correctly due to the notation of D:\NCrunch\ConsoleWorkspace\ in log).
Remco wrote:This setting is being passed through a method to resolve environment variables, so something must be amiss. Are you able to share the value of this environment variable as this exists on your machine?
D:\NCrunch\ConsoleCache (if using this hardcoded path and executing NCrunch via cmd it creates the dir with EmployeeAPI.crunchsolution.cache file in it, using environment variable it doesn't).
Remco NCrunch Developer
#10093
22 Mar 2017 22:43 UTC
Ok, thanks, I've managed to reproduce this now.
NCrunch isn't liking the environment variable exclusively taking up the whole value when trying to parse the storage path as a relative path.
A fix will be included in the next build.
NCrunch isn't liking the environment variable exclusively taking up the whole value when trying to parse the storage path as a relative path.
A fix will be included in the next build.
Post a reply
Log in to reply.