0
的SQLExceptions當訂閱ObjectMaterializeEF6 ObjectMaterialized導致測試
((IObjectContextAdapter)context).ObjectContext.ObjectMaterialized += (sender, e) => { /* Note, fails even when the handler is empty */ }
這部作品在生產代碼罰款。然而,當我加入這個,我得到了測試例外:
Message: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
去除單行(ObjectMaterialized + = ..)再次解析它。我一直在調試,但找不到原因。這裏有沒有人碰巧遇到過這個?