0

I am write an C# library that will use as reference for VBA

This library has service reference for some online product we using and this service reference require an .config file to be in the same folder as the application/dll

when I use the service reference in .net application all work grate. But when I use it in Ms access VBA I gets error about variables that are missing and I know they are in the config file.

I was trying few solutions i found but the problem is I cant change the variables in the reference cause we update it every few weeks.

so I have to include the config file with the .dll without change variables in the project.

Thanks,

config sample that the service reference use:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="Isoapbinding" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://192.168.1.180/soap"
                binding="basicHttpBinding" bindingConfiguration="Isoapbinding"
                contract="time.Isoap" name="IsoapPort" />
        </client>
    </system.serviceModel>
</configuration>
yadv
  • 21
  • 6
  • How are you reading the configuration file? Do you check the assembly's directory or the current thread's directory? – Comintern Aug 03 '18 at 17:02
  • The service reference read it, for example: public partial class TimeClient : System.ServiceModel.ClientBase, TimeTA.Time.Isoap { – yadv Aug 03 '18 at 17:18
  • Configuration isn't just a file that is read at runtime, it is parsed into object instances which are accessed by the ConfigurationManager. I don't know how/if a VBA environment would load that into the app domain. You might have to [do it without an actual config file](https://stackoverflow.com/questions/7785803/add-hardcoded-configuration-without-app-config-file-to-some-assembly) – Crowcoder Aug 03 '18 at 17:29
  • the app.config is generate by the service reference and is structure is : https://learn.microsoft.com/en-us/dotnet/framework/wcf/configuring-services-using-configuration-files any suggestions? – yadv Aug 03 '18 at 22:02

0 Answers0