Relative - to what? That is the issue here. Your solution files live in your solution folder, likely under GIT control or some other form of source control.
When Unicorn executes, it executes in your Web Context (IIS folder) and knows nothing about the solution that was published to it.
No relative path would work here,
~/ is pointing to the IIS "Website" folder.
An interesting - although untested by me - solution to this was also presented on the Unicorn Issues area.
Question: how can I specify a solution relative path for "targetDataStore" configuration property
It basically introduces a
$(solutionFolder) variable that can then be used in the configuration of
I've not tried it myself (and a part of me thinks this is maybe overkill), but wanted to offer up an alternative answer to Richards answer above (which is the approach I use as well).
It involves a T4 template and a config transformation.
<#@ template debug="false" hostspecific="true" language="C#" #><# /* hostspecific must be set to "true" in order to access Visual Studio project properties. */ #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Text" #>
<#@ output extension=".config" #>
<#@ assembly name="EnvDTE" #><# /* This assembly provides access to Visual Studio project properties. */ #>
var serviceProvider = this.Host as IServiceProvider;
var dte = serviceProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
var solutionDirectory = System.IO.Path.GetDirectoryName(dte.Solution.FullName);
<?xml version="1.0" encoding="utf-8"?>
<sc.variable name="solutionFolder" value="<#= solutionDirectory #>"
And then using it in Unicorn