如何将dll应用程序设置添加到web.config文件 [英] how to add dll app settings to web.config file
问题描述
我有一个DLL引用一个Web服务,该DLL在网站中引用我想配置我的来自我的网站web.config的web服务网址如何从网站上实现这一点
我怎样才能在网站的web.config中添加dll.config设置。
< pre lang =c#>< applicationSettings>
< SSOLib.Properties.Settings>
< setting name = SSOLib_AuthService_AuthService serializeAs = 字符串 >
< value> http:< span class =code-comment> // localhost:8080 / AuthService.asmx< / value>
< / 设置 >
< / SSOLib.Properties.Settings >
< / applicationSettings > < pre lang = c# >
< blockquote>你需要写一些类似的东西:
< configuration>
< runtime>
< assemblybinding xmlns =urn:schemas-microsoft-com:asm.v1>
< dependentassembly>
< assemblyidentity name =myAssembly>
publicKeyToken =32ab4ba45e0a69a1
culture =neutral/>
< bindingredirect oldversion =1.0.0.0>
newVersion =2.0.0.0/>
< codebase version =2.0.0.0>
href =http://www.litwareinc.com/myAssembly.dll/>
< / codebase>< / bindingredirect>< / assemblyidentity>< / dependentassembly>
< / assemblybinding>
< / runtime>
< / configuration>
欲了解更多信息,请访问:
http://msdn.microsoft.com/en-us/library/twy1dw1e.aspx
Hi,
I have a DLL which refers a web service and that DLL is referenced in website i want to configure my web service url from my web site web.config how this could be possible from site
how could i add a dll.config settings to web.config of website.
<applicationSettings>
<SSOLib.Properties.Settings>
<setting name="SSOLib_AuthService_AuthService" serializeAs="String">
<value>http://localhost:8080/AuthService.asmx</value>
</setting>
</SSOLib.Properties.Settings>
</applicationSettings><pre lang="c#">
You need to write something like:
<configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="myAssembly"> publicKeyToken="32ab4ba45e0a69a1" culture="neutral" /> <bindingredirect oldversion="1.0.0.0"> newVersion="2.0.0.0"/> <codebase version="2.0.0.0"> href="http://www.litwareinc.com/myAssembly.dll"/> </codebase></bindingredirect></assemblyidentity></dependentassembly> </assemblybinding> </runtime> </configuration>
For more information visit:
http://msdn.microsoft.com/en-us/library/twy1dw1e.aspx
这篇关于如何将dll应用程序设置添加到web.config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!