无法从代码部署dacpac

时间:2018-01-10 15:40:11

标签: c# sql sql-server visual-studio-2015 dacpac

我在本地计算机上有一个dacpac我正在尝试使用代码部署它并且它失败了。出现以下错误 error message

我用来部署dacpac的代码如下

private static void CreateDatabase()
        {
            using (var dacPackage = DacPackage.Load(DacPacFullPath))
            {
                var dacServices = new DacServices(Shared.Environment.Settings.RadanDbNameOrConnectionString());
                dacServices.Deploy(dacPackage, DatabaseName, true);
            }
        }

我检查过的事情

  • DacPacFullPath是正确的
  • dacServices是正确的,即连接字符串是正确形成的。
  • 使用连接字符串中使用的凭据登录SQL及其 工作正常
  • 我在管理工作室手动部署了dacpac,它可以正常工作

我正在使用SQL Server 2016和Visual Studio 2015详细信息如下

SQL Server

Microsoft SQL Server Management Studio                      13.0.16106.4
Microsoft Analysis Services Client Tools                    13.0.1700.441
Microsoft Data Access Components (MDAC)                     10.0.16299.15
Microsoft MSXML                                             3.0 4.0 6.0 
Microsoft Internet Explorer                                 9.11.16299.0
Microsoft .NET Framework                                    4.0.30319.42000
Operating System                                            6.3.16299

Visual Studio 2015

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Professional

LightSwitch for Visual Studio 2015   00322-40000-00000-AA922
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-40000-00000-AA922
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA922
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA922
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   7.0.20622.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2016.2.2    Build 106.0.20160913.91321
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2018 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

非常感谢任何帮助。

0 个答案:

没有答案