1

私は、Ubuntu 16.04デスクトップでEntity Framework Coreを使用してasp.netコアアプリケーションを構築しています。 SQL Serverをインストールして実行しています。 "-dotnet ef migrations Initial"コマンドを正常に実行しました。私は、EFはに接続し、データベースにテーブルを作成できるように、「-dotnet EFデータベース更新」を実行する準備が、私は、端末上でこのエラーを受けています:UbuntuデスクトップでEntity Frameworkコアを使用してasp.netコアMVCプロジェクトをローカルDBに接続する方法

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: TCP Provider, error: 25 - Connection string is not valid)

それはローカルDBですので、私は、私はTCPプロバイダが必要ないと思っていますよね? EFでSQLサーバーに接続する方法を教えてください。

+1

ないローカルDBは、その後、2人の異なる開発者が同じasp.netコアアプリに取り組んでプッシュする方法をUbuntuの – Alexan

+0

で利用可能であるかどうかわからappsettings.jsonファイルに接続文字列を指定します。 appsettings.jsonは両方で同じになるので、githubへの彼らの作業はローカルで開発されますが、Ubuntuで作業する開発者はアプリケーションをテストするために別のDBを使用する必要があります。 これは通常どのように解決されますか? –

答えて

1

{ 
    "ConnectionStrings": { 
    "DefaultConnection": "Server=YOUR_SERVER_NAME;Database=DBNAME;User Id=sa;Password=PASSWORD;Trusted_Connection=True;MultipleActiveResultSets=true" 
    }, 
    "Logging": { 
    "IncludeScopes": false, 
    "LogLevel": { 
     "Default": "Warning" 
    } 
    } 
} 
関連する問題