Access appSettings web link from Biztalk BTSNTSvc.exe.config

Sometimes we use global variables in our BTSNTSvc.exe.config configuration ( BTSNTSvc.exe.config ), we add them with the following code:

 <appSettings> <!--<add key="ZNA_Integratie_Prestaties_OasisProxy_OasisServiceProxy_Service" value="http://localhost/service.asmx" />--> <add key="IPSdatum" value="20090101" /> </appSettings> 

Using the following C # code, we can read the value:

 ConfigurationManager.AppSettings["IPSdatum"] 

Now, when we add a web link to our biztalk projects, we use them through the ports, however, my colleague used the code in the web interface and added one to the aC # class project, so this means that app.config , where the address is . However, when deploying our project, of course, there is no app.config . Only BTSNTSvc.exe.config . I heard that there is a way to add a key value to this configuration, which can reference the value of app.config .

Can someone help me here?

+4
source share
1 answer

Option 1:

BTSNTSvc.exe.config file is a .NET configuration file, you can put the contents that you see inside the app.config file BTSNTSvc.exe.config file in the correct sections.

Option 2:

You can access additional configuration files from the BTSNTSvc.exe.config file using the application domain concept as described here

If you are dealing with multiple entries, option 1 is preferred.

Even better, try not to use embedded web links in your helper classes, try to avoid the situation.

+4
source

Source: https://habr.com/ru/post/1302215/


All Articles