엔티티 프레임 워크를 사용하여 연결을 열려고 할 때이 오류가 계속 발생합니다. 데이터베이스에서 모델을 전혀 문제없이 업데이트 할 수 있지만 디버그에서 코드를 실행하면이 오류가 발생합니다. (윈도우 2008 VM에서 실행) "기본 공급자가 열지 못했습니다."
오류는 다음과 같습니다 나타나는 코드 조각 :
public partial class SpatialDatabase : global::System.Data.Objects.ObjectContext
{
try
{
using (EntityConnection conn = new EntityConnection(this.Connection.ConnectionString))
{
conn.Open(); // <== fails here
EntityCommand cmd = conn.CreateCommand();
...
이 Oracle 데이터베이스에 연결입니다.
이 코드는 분명히 다른 곳에서 실행되고 있으므로 연결과 관련된 느낌이 들었습니다. ODAC (Oracle for .NET) 드라이버를 사용하고 있습니다. 64 비트인지 32 비트인지는 모르지만 모델을 업데이트 할 때 작동하지만 디버그에서는 실행되지 않습니다. 의 app.config에서
(! 내가 보여주기 위해 무엇을 알고 있다면 추가 코드를 보여줄 것)
연결 문자열 :
<connectionStrings>
<add name="SpatialDatabaseContext" connectionString="metadata=res://*/SpatialDatabase.csdl|res://*/SpatialDatabase.ssdl|res://*/SpatialDatabase.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=ds_name_here;PASSWORD=password_here;PERSIST SECURITY INFO=True;USER ID=user_id_here"" providerName="System.Data.EntityClient" />
</connectionStrings>
[편집]
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)
[/ 편집]
[편집 2]
위의 붉은 청어가 될 수 있습니다. 나는 다시 달려 didn를, t 그 오류를 볼 수 있지만, 나는이의 InnerException 봤어 :
[Oracle.DataAccess.Client.OracleException] = {"ORA-12154: TNS:could not resolve the connect identifier specified"}
[/ Edit2가]
[편집 3] 내가 대신 EFOracleProvider를 사용하려고
합니다. 그것은 확인을 구축,하지만 난 엔티티 모델을 생성하기 위해 갈 때이 얻을 :
Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) 2008 Microsoft Corporation. All rights reserved.
error 7001: The provider did not return a ProviderManifestToken string.
Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Generation Complete -- 1 errors, 0 warnings
내가 32 비트 설치 Oracle 클라이언트 구성 요소의 64 비트 버전을 모두 가지고있다. 32 비트 또는 64 비트 실행 여부를 어떻게 선택합니까 ??
[/ EDIT3]
내가 링크의 몇 가지를 발견
의 (실제 이름/PW없이) 당신의 .config 연결 문자열을 추가합니다. 이 오류는 구성 문제와 같습니다. – Kaido
.config 연결 문자열 추가 - 구성 문제라고 생각합니다. 무엇을 모르겠습니다. ( – CompanyDroneFromSector7G
"파이프에 대한 프로세스 없음"또는 무언가 – Kaido