2016-05-20 22 views
1

PowerShellスクリプトを使用してSQLデータベースを展開します。このスクリプトはSqlPackage.exeユーティリティを使用してメインデータベースを公開していますが、SSDTを最新のリリースSSDT 2015にアップグレードするまで問題なく動作していました。アップグレード後にSqlPackage.exeコマンドでエラーが発生する

のPowerShellスクリプトライン:

& "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:"$DatabaseDacpacLocation" /TargetServerName:$DataServerSqlInstance /TargetDatabaseName:$Database /Variables:master="$MasterDatabase" /v:DatabaseName="$pDatabaseName" /p:ExcludeObjectType=Sequences 

エラー:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacPackage' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacServices' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SqlSchemaModelStaticState' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.TransactSql.ScriptDom, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

答えて

4

それはSqlDomバージョン12が欠落しているデプロイメント環境のように見えます(Microsoft.SqlServer.TransactSql.ScriptDom.dll)これはGACに入る予定です。 https://www.microsoft.com/en-us/download/details.aspx?id=42295

ダウンロードしてインストールする必要があるファイルは、x64およびx86バージョンのSqlDom.msiです。このファイルは、次の場所にあります。

現在、SQL Server 2014バージョンのデータ層アプリケーションフレームワークを使用しているようです。 SQL Server 2016バージョンのデータ層アプリケーションフレームワーク(DacFX)に更新する場合、DacFXの新しいバージョン(v13)(SqlSysClrTypes.msiおよびSqlDom.msi)もインストールされていることを確認する必要があります。

関連する問題