尝试在客户端计算机上运行安装程序时失败。安装程序由Wix和C#共同完成。通过查看日志;我有几行错误。
MSI (s) (F4:A4) [01:52:37:027]: Executing op: CustomActionSchedule(Action=sqlcmd,ActionType=1025,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:"C:\Program Files (x86)\<directory>\XYZ_Create.dacpac" /TargetConnectionString:"Data Source=ServerName;Initial Catalog=XYZ;Integrated Security=True")
MSI (s) (F4:C4) [01:52:37:027]: Invoking remote custom action. DLL: C:\windows\Installer\MSI1CAA.tmp, Entrypoint: CAQuietExec
CAQuietExec: Entering CAQuietExec in C:\windows\Installer\MSI1CAA.tmp, version 3.10.2516.0
CAQuietExec: "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:"C:\Program Files (x86)\<directory>\XYZ_Create.dacpac" /TargetConnectionString:"Data Source=ServerName;Initial Catalog=PsrX;Integrated Security=True"
CAQuietExec: Publishing to database 'PsrX' on server 'ServerName'.
CAQuietExec: Initializing deployment (Start)
CAQuietExec: Initializing deployment (Failed)
CAQuietExec: *** Could not deploy package.
CAQuietExec: Unable to connect to target server.
CAQuietExec: Error 0x80070001: Command line returned an error.
CAQuietExec: Error 0x80070001: QuietExec Failed
CAQuietExec: Error 0x80070001: Failed in ExecCommon method
CAQuietExec提到的Wix代码是:
```Wix Code
<CustomAction Id="sqlcmd"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Return="check"
Execute="deferred"
Impersonate="yes" />
```
客户端正在使用SQL Server 2016。
我从网上尝试了一些解决方案: https://blogs.msdn.microsoft.com/sqlserverfaq/2016/10/12/error-could-not-deploy-package-unable-to-connect-to-target-server/(我将DAC文件夹从120复制到130,并尝试过但还是没有运气)。
我已与客户确认登录用户是否有任何访问/特权问题,但他们拒绝了。
此安装程序适用于其他少数客户端。
有人可以在这里帮助我吗?谢谢!
答案 0 :(得分:0)
CAQuietExec只是从您正在调用的EXE记录stdout和stderr。是SQLPackage.exe无法连接到目标服务器,而不是WiX / CAQuetExec。
答案 1 :(得分:0)
如上所述,此客户端正在使用SQL Server2016。
在CustomAction中,它试图从property.wxs中获取所有可用的sql服务器
-- CustomAction Code
string[] sqlVersions = session["SQLVERSIONS"].Split(';');
-- Property.wxs
<Property Id="SQLVERSIONS" Secure="yes" Value="140,130;120;110;100;90"></Property>
这里没有140。因此,它无法找出140 DAC文件夹,因此失败并显示错误。 尝试使用与该客户端不兼容的120个文件夹结构。