Dll Created For Access App cannot locate web services configuration info in App.config file
Posted on 2017-04-20
I've been asked to push some data to an external web service using Access 2010. After researching this all day, it looks like many suggestions point to using Visual Studio to create a dll that utilizes VS's ability to auto generate the web services protocol code, reference then dll in Access and then call it from my Access 2010 VBA code. The web service code works great when bundled as a standalone exe. However, when I compile it into a dll, reference it within Access and then call it from by Access VBA code, I get the following error:
"Could not find the default endpoint element that references contract 'ServiceReference1.NameOfMyDllClass' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."
After a little more digging, it appears that creating a dll does not include the app.config file that contains this configuration information so I'm guessing my DLL can't find the configuration information it needs to initiate the web service transfer. Most recommendations seem to suggest adding the info in the app.config file to the host's app.config but off course Access does not have anything like that.
With so many recommendations to use dlls that wrap the web services when using Access, it sounds like a great way to go but I must be doing something wrong. Any help to get me pointed in the right direction would be appreciated.