views:

400

answers:

1

Hi,

sometimes we use global variables in our biztalk configuration called BTSNTSvc.exe, we add these 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 in the value:

ConfigurationManager.AppSettings["IPSdatum"]

Now normally we when we add a webreference to our biztalk projects we use them through ports, however a collegue of mine used an in code webreference and so added one to a c# class project, so this means there's an app.config where the address is being held. However when we deploy our project there isn't an app.config of course. Only the BTSNTSvc.exe.config. I heard there is a way to add a key value to this config which can refer to the app.config value.

Can anyone help me out here?

Thx a lot

+1  A: 

Option 1: BTSNTSvc.exe.config file is a .NET config file, you can put the content what you see inside your app.config file inside the BTSNTSvc.exe.config file at the correct sections.

Option 2: you can refer to additional config files from BTSNTSvc.exe.config file using the app domain concept as explained here http://msdn.microsoft.com/en-us/library/cc789004.aspx

If you are dealing with only few entries, then option 1 is preferable.

Even better, try not to use inline web references within your helper classes, try to avoid the situation.

Saravana Kumar
Yeah I know, I never do inline web references, it's in a code of an old collegue and we can't really modify it right now. I like option 1, I'll give it a try
WtFudgE
Option 1 worked fine, thanks. In the end I had to remove it anyway, because using this service did not do any retries. So I spend an entire day rewriting his code using a biztalk sendport in the way it should be :)
WtFudgE