Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Env variable in NCrunch Cache Storage Path
vitorio
#1 Posted : Wednesday, November 2, 2016 10:14:54 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/2/2016(UTC)
Posts: 1
Location: Ireland

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/...unch-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
#2 Posted : Wednesday, November 2, 2016 11:14:45 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
GreenMoose
#3 Posted : Wednesday, March 22, 2017 11:53:28 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
[v3.6.0.2]

I use below in my NCrunch console config file:
Quote:

<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.
Remco
#4 Posted : Wednesday, March 22, 2017 12:08:38 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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?
GreenMoose
#5 Posted : Wednesday, March 22, 2017 12:57:46 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
Remco;10083 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;10083 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
#6 Posted : Wednesday, March 22, 2017 10:43:10 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
1 user thanked Remco for this useful post.
GreenMoose on 3/23/2017(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.050 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download