如何将system.serviceModel放入ServiceConfiguration.cscfg(Wind
发布时间:2020-12-14 03:52:36 所属栏目:Windows 来源:网络整理
导读:我有以下代码(适用于Microsoft Translator) system.serviceModel bindings basicHttpBinding binding name="BasicHttpBinding_LanguageService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCoo
我有以下代码(适用于Microsoft Translator)
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_LanguageService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://api.microsofttranslator.com/V2/soap.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_LanguageService" contract="TranslatorService.LanguageService" name="BasicHttpBinding_LanguageService" /> </client> </system.serviceModel> 它在web.config中运行良好.现在我需要将一些translate函数放到Azure Worker Role中,所以我收到错误找不到引用ServiceModel客户端配置部分中的合同’TranslatorService.LanguageService’的默认端点元素.这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素. 我已经找到解决方案是将上面的设置放到ServiceConfiguration.cscfg上,但是如何?我尝试了很多位置但是所有错误都无法部署.请帮忙 解决方法
ServiceConfiguration.cscfg只能包含Azure特定配置(如实例数,配置设置,指纹……).
每当您需要进行常规的.NET配置(例如WCF)时,您只需为您的辅助工具角色创建一个app.config,就像您要用于控制台应用程序并将配置放在此处一样.请注意,如果要将其添加到app.config中,则问题中的示例配置不完整.你应该把它包裹起来: <?xml version="1.0"?> <configuration> ... </configuration> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 批处理文件 – 我如何修复:在Windows 7中使用move命令’访
- .net – 如何在Windows Server 2012 R2上解决PerfView for
- win7/10下Qt Creator调试提示:The selected debugger may
- Gnuplot,来自windows.命令窗口打开和关闭
- windows下安装php的redis
- windows – NHibernate.InstantiationException无法加载测试
- 对于软件工程师,Microsoft或OpenSource / Linux / Java,哪种
- windows-server-2008-r2 – 自动从商店中删除受信任的根证书
- 扩展System.Windows.Forms.Button并更改c#中的默认文本
- Erlang项目无法在由rebar生成的Windows上启动
推荐文章
站长推荐
- winapi – Windows头文件中的“#ifdef _MAC”是什
- Windows – 网络服务帐户或域帐户?
- F12在Windows 7/8上的Delphi调试器中不起作用
- windows-server-2008 – 每晚重启Windows域上所有
- windows-server-2008 – 什么是Windows事件转发的
- 在Windows Vista / 7的C#中显示验证对话框
- .net – System.Windows.Forms.WebBrowser在同一
- 有没有办法在Microsoft Azure存储资源管理器或Az
- 您在Windows环境中使用哪种脚本语言来登录脚本?
- Windows 10通过鼠标悬停延迟激活窗口?
热点阅读