所以我仍然不确定这是在我这边,还是在服务那边,还是在双方。我不知道问题的主要来源在哪里,但我会尽力解释我已经采取的步骤,以及到目前为止发生的事情,你们已经掌握了所有的信息,你们需要和我正面交锋。
所以我们有一个名为api.svc的Web服务类,它实现了一个包含一个方法的类。在api类中,调用是在服务中发出的,但是在此之前它似乎失败了,所以我认为问题是在本地出现的。注意,我说过我想。
我们第一次遇到错误是正常运行代码,并且在一段时间内不测试代码之后测试它。当我们单击贯穿所有呼叫(最终需要点击服务呼叫)的按钮时返回的错误是:
System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Akcelerant.Core.Data.DAL.SQL.OpenConnection()
at Akcelerant.Core.Data.DAL.SQL.BuildCommand(String SQL)
at Akcelerant.Core.Data.DAL.SQL.Execute(String SQL, Int32& Retur...).
现在,在调试时,Visual Studio不允许我调试到实现类的Web服务类(api.svc)。它想出了一个对话框,上面说,“远程调试在指定的实例上不可用”,或者类似的话。它问我是否要启用它,所以我单击了“是”,但我认为它并不真正起作用。现在,当我尝试进入它时,我得到了一个异常,它是这样写的:
"Unable to automatically step into the server. Connecting to the server machine 'qa2automated' failed. The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. Please see Help for assistance."
但是,它不会让我读取异常(不过,我假设它与不调试时得到的相同)。我刚才描述的错误消息是一个弹出在Visual Studio中的对话框。qa2automated'是我们网络上的服务器,但不是我正在使用的服务器。这跟它有什么关系吗?当我现在开发完全本地的时候,它为什么要尝试连接到一个非本地服务器呢?但是,当此代码在“qa2automated”服务器上运行时,它会收到相同的错误。我很困惑。
这可能是什么?我真的在这件事上被难住了这么久。有人知道解决这个问题的方法吗,或者确切的问题是什么?