Excel Add-In not loading app.config with service reference config information

后端 未结 3 738
慢半拍i
慢半拍i 2020-12-06 23:18

I\'ve written an app with a service reference to make web services calls to a specific URL and it works great. I want to move this code into an Excel Add-In, but I run into

3条回答
  •  广开言路
    2020-12-07 00:14

    As @hexboy noted in his comment, the answer is that ExcelDNA requires the config file to be the same name as the "xll" file but with a ".config" extension. Then ExcelDNA will load the configuration automatically and no further code is required.

    Note also that ExcelDNA produces various different files on build. E.g. addin.xll, addin-packed.xll, addin64.xll, addin64-packed.xll where the project assembly is named addin.

    In order for a config file to be picked up, it needs to match the file name that is used for the add-in. E.g. addin-packed.xll.config if using addin-packed.xll as the registered Excel add-in.

提交回复
热议问题