Adding an appsetting to the root web.config file in a helix solution

350 views Asked by At

We are trying to figure out how to add an appsetting into the root websites web.config from a helix feature project. Its my understanding that if you add a transform file e.g (web.config.transform) into the root of your feature project and build the project using the helix gulp script, the transform should update the root config. Is this correct? Unfortunately when we run the gulp script we get an error

    [11:26:54] Starting '04-Apply-Xml-Transform'...
[11:26:55] Applying configuration transform: D:\Projects\xxxxxxx\src\Feature\Claims\code\xxxxx.Website.Feature.Claim\App_Config\Include\Web.config.transform
D:\Projects\xxxxxxx\scripts\applytransform.targets(14,5): error : Could not open Source file: Could not find a part of the path 'C:\inetpub\wwwroot\xxxxxxxxx\website\xxxxxxx.Website.Feature.Claim\App_Config\Include\Web.config'.
Process terminated with code 1.
[11:26:56] MSBuild failed with code 1!
[11:26:56] '04-Apply-Xml-Transform' errored after 1.59 s
error!
[11:26:56] Error: MSBuild failed with code 1!
    at ChildProcess.<anonymous> (D:\Projects\xxxxxxxxxxxx\node_modules\gulp-msbuild\lib\msbuild-runner.js:66:25)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

It looks to me as like it is trying to update a local web.config.

1

There are 1 answers

0
Mark Cassidy On

Your web.config would not reside here C:\inetpub\wwwroot\xxxxxxxxx\website\xxxxxxx.Website.Feature.Claim\App_Config\Include\Web.config

It would reside here: C:\inetpub\wwwroot\xxxxxxxxx\website\Web.config