Open lanfeust69 opened 5 years ago
Thanks for reporting this one @lanfeust69.
I've been meaning to do some work on this for a while, ever since I tried to use slow-cheetah with Excel-DNA add-ins, which also makes changes to the final App.config
file, that are not picked-up by the CreateExcelAddIn
.
The workaround you have probably works for 95% of the use-cases, but I'm afraid a fix wouldn't be as simple as baking in what your workaround does, because:
.dna
file, and an .xll
w/ a .config
gets created for each one.dna
file via ExternalLibrary
so to get the "correct" enriched .config
for each .dna
. We'd have to know which assembly to use first - and that might mean parsing each .dna
file during the build process :unamused: ... That also brings the question of what to do when a .dna
file has more than one ExternalLibrary
element (supported).Any chance you're interested in sending a PR to improve this story?
@augustoproiete : thanks for the additional insights.
I didn't have the time to dig things deeper and come up with a PR, and that's why I opened the issue in the first place, to keep track 🙂.
I don't expect to be able to investigate further in the coming weeks, but hopefully I can find a bit of time later on...
When an addin's csproj has both the
AutoGenerateBindingRedirects
andGenerateBindingRedirectsOutputType
properties defined totrue
, theApp.config
file is (potentially) enriched with needed bindingRedirects when it is copied asMyAddIn.dll.config
.However, within the
CreateExcelAddIn
task, the handling ofApp.config
uses the originalApp.config
, and therefore misses the bindingRedirects.As a workaround, one can add to the csproj a target along the lines of :
But it would probably be better to try to use the processed
MyAddIn.dll.config
file in the task.