[英]No connection could be made because the target machine actively refused it 127.0.0.1:8000
[英]ASP.Net 4.5 with DataService: No connection could be made because the target machine actively refused it 127.0.0.1
方案:我有一個簡單的.Net解決方案,其中包含兩個項目:一個網站和一個DataService。
我都將Web.config都設置為具有與本地SQL Server實例正確(經過測試)的連接字符串。
運行(調試)應用程序后,出現錯誤:
Server Error in '/' Application.
No connection could be made because the target machine actively refused it 127.0.0.1:55883
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:55883
Source Error:
Line 163: };
Line 164:
Line 165: var app = (from a in DbSvcContext.viewApplications
Line 166: select new CustomizedApplicationData {
Line 167: aId = a.aId,
Source File: c:\Development\mySite\mySite_Admin\mySite.Web\Admin\Applications.aspx.cs Line: 165
Stack Trace:
[SocketException (0x274d): No connection could be made because the target machine actively refused it 127.0.0.1:55883]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +309
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse() +6594148
System.Data.Services.Client.HttpWebRequestMessage.GetResponse() +23
System.Data.Services.Client.WebUtil.GetResponseHelper(ODataRequestMessageWrapper request, DataServiceContext context, IAsyncResult asyncResult, Boolean handleWebException) +223
System.Data.Services.Client.QueryResult.ExecuteQuery(DataServiceContext context) +610
System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +457
System.Data.Services.Client.DataServiceQuery`1.Execute() +77
System.Data.Services.Client.DataServiceQuery`1.GetEnumerator() +13
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
mySite.Web.Admin.Applications.GetApplications() in c:\Development\mySite\mySite_Admin\mySite.Web\Admin\Applications.aspx.cs:165
Sceip.Web.Admin.Applications.Page_Load(Object sender, EventArgs e) in c:\Development\mySite\mySite_Admin\mySite.Web\Admin\Applications.aspx.cs:151
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009
我該如何克服? 我需要能夠調試此站點,但是除非能夠運行它,否則我是SOL。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.