共享.net dll中的ServiceModel配置-最佳实践 [英] ServiceModel configuration in shared .net dll - best practices

查看:42
本文介绍了共享.net dll中的ServiceModel配置-最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我希望有人可以帮助解决.net dll配置问题.我已经开发了一个com可见的.net dll,该文件将由编写成.net和vb6的许多应用程序共享.该dll访问几个Web服务,我不想不必提供 每个引用此dll的每个应用程序的serviceModel配置.我尝试从调用应用程序中分离dll配置的每一次尝试都只是绕过了dll app.config.有人可以告诉我什么是共享的最佳实践 配置在运行时将不会被忽略.

在此先感谢

AW

Hi
I was hoping someone could help with a .net dll configuration issue. I have developed a com visible .net dll that will be shared by a number of applications written .net and vb6. The dll accesses several web services and I would like to not to have to supply serviceModel configuration for each every application that references the this dll. Every attempt I have tried to separate the dll config from the calling app has simply by-passed the dll app.config. Could some tell me what is What is best practice for a shared configuration that will not be ignored at run time.

thanks in Advance

AW

推荐答案

配置属于托管应用程序,而不是.dll.要为WCF配置VB6应用程序托管的COM组件,我将 代码中的配置.然后,要求主机程序提供配置值(可能只是端点URI),或者自己从某个已知位置读取它们.

Configuration belongs to the hosting application, not the .dll.  To configure a COM component hosted by a VB6 application for WCF, I would do the configuration in code.  Then require the host program to provide the configuration values (probably just an endpoint URI), or read them yourself from some known location.

这是来自SSIS的一个示例,这是一个类似的场景.

Here's an example from SSIS, which is a similar scenario.

David


这篇关于共享.net dll中的ServiceModel配置-最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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