关于如何在BizTalk中为项目创建单独的配置文件[翻译]

有时候为了BizTalk的维护方便有些信息需要放到配置文件里面。BizTalk提供了在C:\Program
Files\Microsoft Biztalk Server 2004(2006)\BTSNTSvc.exe.config 进行配置的功能。但是如果项目多了也不好维护。以下的方法是通过配置BTSNTSvc.exe.config实现给单独的项目独立的配置文件的方法。

1. BTSNTSvc.exe.config 的配置

<ConfigSections>
<section name="xlangs"
type="Microsoft.XLANGs.BizTalk.CrossProcess. XmlSerializationConfigurationSectionHand
ler, Microsoft.XLANGs.BizTalk.CrossProcess" />
</configSections>

<xlangs>
<Configuration>
<AppDomains AssembliesPerDomain="10">
<AppDomainSpecs>
<AppDomainSpec Name="MyAppDomain" SecondsIdleBeforeShutdown="-1"
SecondsEmptyBeforeShutdown="12000">
<BaseSetup>
<ConfigurationFile>c:\temp\app.config</ConfigurationFile>
</BaseSetup>
</AppDomainSpec>
</AppDomainSpecs>
<ExactAssignmentRules>
<ExactAssignmentRule AssemblyName="myAssemblyName, Version=1.0.0.0
Culture=neutral PublicKeyToken=5a4c37737373" AppDomainName="MyAppDomain" />
</ExactAssignmentRules>
</AppDomains>
</Configuration>
</xlangs>

c:\temp\app.config的配置信息

<configuration>
<appSettings>
<add key="mykey" value="myvalue" />
</appSettings>
</configuration>

完成以上配置之后你可能在Orchestraction表达式或类库里通过以下的方式获取到值:
System.Configuration.ConfigurationSettings.AppSettings("mykey")

更改 BTSNTSvc.exe.config的信息之后请重启BizTalk Host以确保更改的信息能被应用。
希望这篇文件对您有帮助。
Cheers
Ben Jiang

posted on   Gary Zhang  阅读(323)  评论(0编辑  收藏  举报

编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!

导航

点击右上角即可分享
微信分享提示