我在下面提到的两件事上得到WCFexception
通信对象System.ServiceModel.ServiceHost不能用于通信,因为它处于Faulted状态。
IP端点0.0.0.0:9000上已有一个侦听器。确保您没有尝试在应用程序中多次使用此端点,并且没有其他应用程序在此端点上进行侦听。
如果我们尝试浏览,我们得到的页面无法显示消息。如果我们重新启动服务器/服务,它将开始工作。我是WCF的新手。请帮我解决这个问题。
提前致谢。
Please find below the stack trace
Message: HandlingInstanceID:
An exception of type 'System.ServiceModel.AddressAlreadyInUseException' occurred and was caught.
----------------------------------------------------------------------------
Type : System.ServiceModel.AddressAlreadyInUseException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : There is already a listener on IP endpoint 0.0.0.0:9000. Make sure that you are not trying to use this endpoint multiple times in your application and that there are no other applications listening on this endpoint.
Source : System.ServiceModel
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Listen()
Stack Trace : at System.ServiceModel.Channels.SocketConnectionListener.Listen()
at System.ServiceModel.Channels.BufferedConnectionListener.Listen()
at System.ServiceModel.Channels.ExclusiveTcpTransportManager.OnOpen()
at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at PRWCFWindowsHost.HostEngine.StartPRSyncService() in F:\Source Code\Application\PRApplication\PR_SOURCECODE_VSS_MARCH\PR.root\PR\PRWCFWindowsHost\HostEngine.cs:line 101
TimeStamp : 06/10/2015 08:45:02
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : WindowsHost.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\SYSTEM
Inner Exception
---------------
Type : System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Only one usage of each socket address (protocol/network address/port) is normally permitted
Source : System
Help link :
ErrorCode : 10048
SocketErrorCode : AddressAlreadyInUse
NativeErrorCode : 10048
Data : System.Collections.ListDictionaryInternal
TargetSite : Void DoBind(System.Net.EndPoint, System.Net.SocketAddress)
Stack Trace : at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at System.ServiceModel.Channels.SocketConnectionListener.Listen()
Message: HandlingInstanceID: 6978b145-1b73-443d-917c-839221b6bab8
An exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred and was caught.
-------------------------------------------------------------------------------------------------------
10/06/2015 10:55:23
Type : System.ServiceModel.CommunicationObjectFaultedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.
Source : System.ServiceModel
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Close(System.TimeSpan)
Stack Trace : at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Close()
at WindowsHost.HostEngine.OnStop() in F:\Source Code\Application issue\PRApplication\PR_SOURCECODE_VSS_MARCH\PR.root\PR\WindowsHost\HostEngine.cs:line 84
Additional Info:
MachineName :
TimeStamp : 06/10/2015 08:55:23
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : WindowsHost.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\SYSTEM
Message: HandlingInstanceID: 1ca8f69a-8e36-4e99-a5eb-e`enter code here`5f0e5dc7a28
An exception of type 'System.IO.FileNotFoundException' occurred and was caught.
-------------------------------------------------------------------------------
10/06/2015 11:52:33
Type : System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Could not find file 'C:\ProcessLog.log'.
Source : mscorlib
Help link :
FileName : C:\RunProcessLog.log
FusionLog :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void WinIOError(Int32, System.String)
Stack Trace : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at ITG.PR.BusinessLayer.FileManager.ReadResultSetRebuildLogFile(List`1 lResultSetList, Hashtable PreviousResultSet)
at ITG.PR.PRWCFService.SyncedService.ReadResultSetRebuildLogFile(List`1 lResultSetList, Hashtable PreviousResultSet) in F:\Source Code\Application\PRApplication\PR_SOURCECODE_VSS_MARCH\PR.root\PR\PRWCFService\SyncedService.cs:line 3094
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : WindowsHost.exe
ThreadIdentity : IIS APPPOOL\DoAppPool
WindowsIdentity : NT AUTHORITY\SYSTEM
答案 0 :(得分:0)
我假设您在visual studio中收到此错误。转到项目文件的属性。在Web选项卡中查找项目URL。您会找到http://localhost:9000/之类的网址。在此处提供不同的端口号,例如http://localhost:11483/