从Biztalk Orchestration调用.Net程序集:将配置放在哪里? [英] Call .Net assembly from Biztalk Orchestration: Where to put config?

查看:85
本文介绍了从Biztalk Orchestration调用.Net程序集:将配置放在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含app.config的外部.net程序集,我需要从Biztalk流程中调用它.

我已经将一些日志记录到.net程序集中,并且看到它没有读取或找不到app.config文件,因为ConfigurationManager.AppSettings.Count为0

我使用gacutil/i path.to.dll将.net程序集安装到了GAC,但我不确定app.config会发生什么.

从Biztalk Orchestration调用app.config时如何确保读取app.config的任何想法?

谢谢.

解决方案

BizTalk使用它自己的配置文件btsntsvc.exe.config,该文件位于BizTalk程序文件目录中.您可以将配置部分添加到此文件中,然后重新启动biztalk主机实例以获取更改.

但是,这不是一个好习惯.如果只有一台biztalk应用程序服务器,则可以这样做,但是如果需要突然扩展,则可以维护多个配置文件.

推荐的方法是使用SSO存储特定于应用程序的配置数据,因为它是BizTalk的配置存储解决方案,因此始终可用.我一直使用这种方法,从来没有遇到任何问题(尽管与开发和管理相关的一些开销).

有关此操作的详细信息,请参见此处使用修改的版本.

我还使用MSBuild任务此处自动执行新配置的部署.

编辑:已发布代码,用于包装SSOCLient并在此处 调用配置值>

I got a external .net assembly including app.config which I need to call from a Biztalk Orchestration.

I've put some logging into the .net assembly and can see that it doesn't read or can't find the app.config file as ConfigurationManager.AppSettings.Count is 0

I installed the .net assembly to the GAC using the gacutil /i path.to.dll and i'm not sure what happens to the app.config.

Any ideas on how I make sure the app.config is being read when I call it from a Biztalk Orchestration ?

Thanks.

解决方案

BizTalk uses it's own configuration file called btsntsvc.exe.config which is in the BizTalk program files directory. You can add your configuration sections into this file and then bounce the biztalk host instances to pick up the changes.

HOWEVER, this is not good practice. It's OK to do this when you have only a single biztalk app server but if you need to scale out suddenly you have multiple config files to maintain.

The recommended approach is to use SSO to store app-specific config data, since it's BizTalk's config storage solution and therefore always available. I always use this method and have never had a any problems (although there is some overhead associated with development and management).

Details of how to go about this are here in Richard Seroter's blog.

I actually use a modified version here.

I also use the MSBuild task here to automate the deployment of new config.

Edit: posted code for wrapping the SSOCLient and calling the configuration values here

这篇关于从Biztalk Orchestration调用.Net程序集:将配置放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆