1

I have some Unicorn configuration files which use a specific $variable for the physicalRootPath:

physicalRootPath="$(sourceFolder)\foundation\Serialization\Serialization"

Now I would like to have the $sourceFolder variable be dependent of the Sitecore standard $dataFolder variable. So I have defined:

<sc.variable name="sourceFolderPublic" value="$(dataFolder)\Serialization" />

But when I run /unicorn.aspx I get the following error: enter image description here It seems the $(dataFolder) variable is not filled in?

I've narrowed it down even further. In the root Sitecore.config I have directly defined the following config and it works: working config But when I use this it doesn't work (crash) not working config This is the stacktrace enter image description here

2 Answers 2

1

I'm hoping you already solved this, but I think I see the problem:

physicalRootPath="$(sourceFolder)\foundation\Serialization\Serialization"

This is your configuration for the physicalRootPath - note that your variable is called sourceFolder

This is your definition for your variable:

<sc.variable name="sourceFolderPublic" value="$(dataFolder)\Serialization" />

Note that you have called that sourceFolderPublic - make these 2 variables match and it should work ok.

0

I performed something similar to what you're trying to achieve and it worked fine. The "datafolder" variable was replaced accordingly. Can you check your ShowConfig.aspx and see if it's being applied. You should see the updated targetDataStore's physicalRoot. If you still see the "dataFolder" variable, then it's likely not finding it.

2
  • Hi Marco. Thank you for looking at this! I seem to be having a problem with the order in which the variables are resolved. If I don't use $(sourceFolderPublic) in my Unicorn files I do see it resolves fine in Showconfig.aspx. It seems unicorn uses the configuration before it is completed?
    – Gluip
    Commented Jan 11, 2018 at 9:28
  • @Gluip, you can either ensure this file is patched later by placing it in a folder that's name starts with "z" or use patch:after attributes to do the same thing. Or you could make sure the config that sets the datafolder variable is set earlier. Commented Jan 15, 2018 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.