我有一个调用WCF服务的WPF程序。它在我的电脑上工作正常,但在客户PC上我收到以下错误。
[页脚] [标题] 2011-12-20 10:54:29,809 [5]警告 Kern.Common.Logging.Logger - 登录时出错 - 发生异常 在操作过程中,使结果无效。检查InnerException 有关例外情况。 2011-12-20 10:54:29,928 [5]警告 Kern.Common.Logging.Logger - 内部异常 - System.TypeLoadException:无法加载类型'ChannelBase
1' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at KernMobile.Data.Server.KernMobileWcfService.KernServiceClient.CreateChannel() at System.ServiceModel.ClientBase
1.CreateChannelInternal()at System.ServiceModel.ClientBase1.get_Channel() at KernMobile.Data.Server.KernMobileWcfService.KernServiceClient.KernMobile.Data.Server.KernMobileWcfService.IKernService.BeginLogin(String username, String password, AsyncCallback callback, Object asyncState) at KernMobile.Data.Server.KernMobileWcfService.KernServiceClient.OnBeginLogin(Object[] inValues, AsyncCallback callback, Object asyncState) at System.ServiceModel.ClientBase
1.InvokeAsync(BeginOperationDelegate beginOperationDelegate,Object [] inValues,EndOperationDelegate endOperationDelegate,SendOrPostCallback operationCompletedCallback, Object userState)
我打开了WCF跟踪,但日志文件中没有报告错误。
这是服务配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IKernService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
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://localhost/Kern.Server.Service/KernService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IKernService"
contract="KernMobileWcfService.IKernService" name="BasicHttpBinding_IKernService" />
</client>
</system.serviceModel>
有什么想法吗?
答案 0 :(得分:0)
最后解决了这个问题。
这是因为使用可移植库项目作为WCF服务引用的包装器。
这在大多数PC上运行良好,但客户锁定硬件失败了。我假设有一些支持DLL丢失了。
我改变了一个普通的类库项目并且都工作了。