Dir targetPath doesn't support property substitution

May 19, 2016 at 9:22 PM
I added the following to my wix# Project, but got a folder called "[MASTERVIDEOROOT]" instead of a folder named by the property value...

WEBSITE and WEBPORT work fine.

Is this by design? Why?
                , new Dir("[MASTERVIDEOROOT]"
                    , new IISVirtualDir {
                        Alias = "video",
                        WebSite = new WebSite($"[WEBSITE]", $"*:[WEBPORT]"),
May 20, 2016 at 12:09 AM
Have a look at your wxs file and you will see the problem. You are setting the name but not the id of the your Dir. And with WiX if you want to substitute the directory name with the property value then your dir must have the id identical to the property name:
var project =
            new Project("MyProduct",
                new Dir(@"%ProgramFiles%\My Company\My Product",
                    new File(@"Files\Bin\MyApp.exe")),
                    new Dir(new Id("TESTDIR"), "dummy", 
                        new File(@"Files\Docs\Manual.txt")),
                new Property("TESTDIR", @"c:\A_TestDir"));