问题描述
我们的一个构建服务器刚刚更新到最新的用于数据库工具的 Microsoft SQL Server 更新"(版本 12.0.60629.0),现在与我们拥有的 SqlPackage.exe 版本不兼容(在 C:\Program Files(x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\SqlPackage.exe).SQL Server 数据库项目(针对 SQL Server 2014)构建没有错误,但是当我们尝试使用 SqlPackage.exe 将 .dacpac 部署到目标服务器时,我们收到以下错误:
One of our build servers has just been updated to the latest "Microsoft SQL Server Update for database tooling" (version 12.0.60629.0) and is now incompatible with the version of SqlPackage.exe we have (in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\SqlPackage.exe). The SQL Server database project (targeting SQL Server 2014) builds without error, but when we attempt to deploy the .dacpac to the target server using SqlPackage.exe, we get the following error:
The Element or Annotation class PersistedResolvableAnnotation does
not contain the Property class Length.
果然,将成功构建的 model.xml 文件(在 .dacpac 中)与最新构建的文件进行比较,我在一些 Annotation 元素下看到了额外的Length"和Offset"属性:
Sure enough, comparing the model.xml files (inside the .dacpac) for a successful build against this latest one, I see additional "Length" and "Offset" properties under some Annotation elements:
<Annotation Type="PersistedResolvableAnnotation" Name="[$(MyLinkedServer)].[$(MyDatabase)]|[dbo].[SomeTableName]">
<Property Name="TargetTypeStorage" Value="ISqlSynonymTarget" />
<Property Name="Length" Value="63" />
<Property Name="Offset" Value="37" />
</Annotation>
这些构建服务器只有 Visual Studio 2012 和 2013, 2015.很明显,这个最新的 SSDT 更新已经破坏了与 SqlPackage 的兼容性(还有其他indications 在线相同的问题),但我的问题是:我该如何解决?
These build servers have only Visual Studio 2012 and 2013, not 2015. It seems fairly clear that this latest SSDT update has broken compatibility with SqlPackage (and there are other indications online of this same issue), but my question is: how do I solve it?
我宁愿不尝试降级到以前的 SSDT 版本,但会在必要时这样做.我应该安装最新数据层应用程序框架和改用它的 SqlPackage.exe 吗?还是安装 Visual Studio 2015?
I would rather not try to downgrade to the previous SSDT version but will do so if necessary. Should I install the latest Data-Tier Application Framework and use its SqlPackage.exe instead? Or install Visual Studio 2015?
推荐答案
这是在最近的 SSDT 更新中引入的问题.它已在内部修复,并计划包含在 SSDT 的下一个 (16.4) 版本中.SSDT 版本最初通过 SSDT 下载页面发布,并在SSDT 团队博客,然后在 2-3 周内推出 Visual Studio 扩展和更新(如这在单独的 VS 范围内进行).
This is an issue introduced in a recent SSDT update. It has been fixed internally and is targeted for inclusion in the next (16.4) release of SSDT. SSDT releases are initially released via the SSDT download page with notifications on the SSDT Team Blog, and then roll out over Visual Studio Extensions and Updates within 2-3 weeks (as this goes on a separate VS-wide schedule).
- 注意:对于 VS2013 版本,请转到下载站点上的以前的版本"页面.SSDT 将继续针对 VS2013 进行更新,但下载页面已针对用户进行了优化,以获取最新版本的 Visual Studio.
- Note: For VS2013 releases please go to the "Previous Releases" page on the download site. SSDT continues to be updated for VS2013 but the download page is optimized for users to get the latest version of Visual Studio.
披露:我在 SSDT 团队工作
Disclosure: I work on the SSDT team
这篇关于最新的 SSDT 与 SQL Server 2014 的 SqlPackage 不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!