2011-02-03 33 views
5

Tôi có một tình huống mà tôi không thể lưu trữ một dịch vụ bằng cách sử dụng net.tcp dưới cửa sổ 7 nhưng nó hoạt động tốt trên máy chủ Windows 2008. Tôi đã kích hoạt WS, và thực hiện các thiết lập tương tự trong cả hai cửa sổ 7 và cửa sổ máy chủ nhưng đối với một số lý do nó không hoạt động trong windows 7. Lỗi tôi nhận được ở phía khách hàng là:Có sự khác biệt nào trong việc lưu trữ các dịch vụ net.tcp wcf trong Windows 7 và Windows 2008 Server trong IIS không?

System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost:908/TcpTest/MySuperService.svc' is unavailable for the protocol of the address. 

Server stack trace: 
    at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper) 
    at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open() 

Và trong Nhật ký sự kiện Tôi nhận được lỗi sau cho dịch vụ:

An error occurred while trying to listen for the URL '/LM/W3SVC/9/ROOT/TcpTest'. This worker process will be terminated. 
Sender Information: net.tcp 
Exception: System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler/24230272 
Process Name: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: . 
    at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register() 
    at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting) 
    at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting) 
    at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token) 
    at System.ServiceModel.Activation.HostedTcpTransportManager.Start(Int32 queueId, Guid token, Action messageReceivedCallback) 
    at System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler.OnStart() 
    at System.ServiceModel.WasHosting.BaseAppDomainProtocolHandler.StartListenerChannel(IListenerChannelCallback listenerChannelCallback) 
Process ID: w3wp 

Web.config hoàn toàn giống với dịch vụ trên cả windows 7 và windows 2008. Mọi manh mối?

Trả lời

0

Có vẻ như nó đang hoạt động. Tôi có một máy tính mới bây giờ và thử lại lần nữa mà không gặp vấn đề gì cả. Vì vậy, nó sẽ làm việc tốt để lưu trữ net.tcp trên Win 7 với IIS7.

0

Tôi đoán bạn đã giải quyết nó từ ... Có phải trường hợp portsharing không được bật không? http://msdn.microsoft.com/en-us/library/aa395195.aspx

+0

Thực ra tôi đã không làm cho nó hoạt động trên máy tính của mình, tôi phải triển khai nó đến máy chủ thử nghiệm để làm cho nó hoạt động. –

+0

và nó không phải là chia sẻ cổng, kể từ khi tôi cấu hình đó. –

9

Tôi đã có cùng một vấn đề này, trong đó thông điệp ngoại lệ kết thúc bằng

... NetTcpPortSharing service: . 

mang đến cho không có đầu mối nơi để đi từ đó.

Hóa ra là dịch vụ net.tcp Listener Adaptor được trỏ đến NET 3 và các dịch vụ chia sẻ Cảng net.tcp đã được trỏ đến .NET 4

tôi đã có thể nhanh chóng khắc phục nó bằng cách chạy

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ServiceModelReg.exe -r 
+0

Có thể là giải pháp, tôi không có máy chủ đó nữa để xác minh nó. –

+0

công cụ dòng lệnh đó là gì? làm gì? Làm thế nào bạn thấy rằng một dịch vụ được trỏ đến 3 và một dịch vụ khác là 4? – MorganTiley

+0

Ahh tôi thấy - nếu bạn nhìn vào đường dẫn tập tin của các dịch vụ bạn có thể thấy một là trỏ đến v3 trong khi khác là v4. Tôi chạy lệnh và nó đã sửa nó. Cảm ơn hortman! – MorganTiley

Các vấn đề liên quan