2016-08-24 62 views
0

我正在使用Microsoft.ServiceBus.dll(版本2.1)爲了在Windows Server 1.1的服務總線上工作。QueueClient發送拋出「無法連接到net.tcp://xxx.servicebus.windows.net:9354 /」錯誤

我們也希望這個庫能夠與Azure服務總線對話。它只能在一個域中的計算機上運行(不受端口限制)。但是,在更受限制的域(某些端口被阻止)的計算機上,我遇到了以下錯誤。如果我切換Microsoft.ServiceBus.dll 3.0,則相同的代碼在受限域中工作。爲什麼Microsoft.ServiceBus.dll 3.0可以工作而Microsoft.ServiceBus.dll 2.1不能在同一個實驗室(域)中工作?

Could not connect to net.tcp://xxx.servicebus.windows.net:9354/. The connection attempt lasted for a time span of 00:00:20.9992011. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 40.86.102.100:9354.
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.ServiceBus.Messaging.IteratorAsyncResult 1.RunSynchronously() at Microsoft.ServiceBus.Messaging.MessageSender.OnSend(TrackingContext trackingContext, IEnumerable 1 messages, TimeSpan timeout) at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout) at Microsoft.ServiceBus.Messaging.MessageSender.Send(BrokeredMessage message) at Microsoft.ServiceBus.Messaging.QueueClient.Send(BrokeredMessage message)

當我用Microsoft.ServiceBus.dll 3.0交談SB爲Windows Server 1.1,我得到了以下錯誤: 「遠程服務器返回錯誤:(400)錯誤的請求的API版本在查詢字符串中不受支持,可以將其從Uri中刪除或使用'2012-03,2012-08,2013-04,2013-07'之一。「

基於此鏈接Service Bus 1.1 creating Queue with WindowsAzure.ServiceBus dll,我必須使用Microsoft.ServiceBus.dll 2.1。 我想使用Microsoft.ServiceBus.dll版本,可以與Windows Server 1.1的Azure服務總線和SB通話。看來2.1是唯一的選擇,但它給了我在該受限域中的問題 。

回答

0

Why does Microsoft.ServiceBus.dll 3.0 work and Microsoft.ServiceBus.dll 3.1

根據您的描述,看起來你寫錯了版本的Microsoft.serverBus.dll 3.1。我們可以理解爲2.1版嗎?

從微軟Azure服務總線的發佈說明,我們可以發現如下信息:

•一般:編譯針對.NET 4.5 - .NET 4.0的項目將需要重新編譯針對.NET 4.5爲好。 •常規:刪除所有Messaging和EventHub類的舊開始/結束樣式異步API。請改用任務庫異步API。

3.0以上版本將針對.Net4.5進行編譯。所以如果你的應用程序使用.Net 4.5。最好選擇高於3.0的Microsoft.ServiceBus.dll版本。

+0

對,我的意思是說爲什麼Microsoft.ServiceBus.dll 3.0工作和Microsoft.ServiceBus.dll 2.1?對不起,錯字。 我在描述使用Microsoft.ServiceBus.dll 3.0或更高版本的問題的原始問題中添加了兩段。 – DLin1

相關問題