ExcelDna icon indicating copy to clipboard operation
ExcelDna copied to clipboard

Hard coded references to App.config prevents use of config transforms in build.

Open goliat43 opened this issue 5 years ago • 2 comments

I'm trying to create a package ExcelDna Xll with a config that is transformed by SlowCheetah before the Dna build/pack steps.

Not really sure how this should be handled. 'Normal' course of action as far as I know is to find app.config by looking at the 'AppConfigWithTargetPath' build property.

Source/ExcelDna.AddIn.Tasks/BuildTaskCommon.cs

private string GetAppConfigFileNameAs32Bit()
{
    return GetFileNameWithBitnessSuffix("App.config", _fileSuffix32Bit);
}

private string GetAppConfigFileNameAs64Bit()
{
    return GetFileNameWithBitnessSuffix("App.config", _fileSuffix64Bit);
}

goliat43 avatar Dec 19 '19 12:12 goliat43

Thanks @goliat43. We're aware of this and the workaround at the moment is to replace the .xll.config files with the contents of the .dll.config file at the end of the build, after the transformation has been applied.

You can take a look at this example by @lanfeust69.

If you'd like to send a PR to fix this, that would be great, otherwise I'll get to it as part of the work I'm doing in #193.

augustoproiete avatar Dec 19 '19 23:12 augustoproiete

Thank you! Not sure how I managed to miss that issue.

I actually looked at doing a PR but quickly ended up in the conclusion that the interaction is fairly complex and felt that there was a big risk of me missing something vital and breaking the builds for a lot of people. The linked issue clarified some questions however so I might take another look at it.

goliat43 avatar Dec 20 '19 09:12 goliat43