我正在尝试使用SQL Server数据库部署发行任务来部署dacpac,并且我想使用/ p:DoNotDropObjectTypes = Users; Permissions参数来防止某些对象被删除,但是我正在使用以下错误:
2018-08-13T15:48:30.2644849Z ##[section]Starting: Deploy using : dacpac
2018-08-13T15:48:30.2655188Z ==============================================================================
2018-08-13T15:48:30.2655399Z Task : SQL Server Database Deploy
2018-08-13T15:48:30.2655603Z Description : Deploy to SQL Server Database using DACPAC or SQL scripts
2018-08-13T15:48:30.2655749Z Version : 0.3.11
2018-08-13T15:48:30.2655878Z Author : Microsoft Corporation
2018-08-13T15:48:30.2656030Z Help : [More Information](https://aka.ms/sqldacpacmachinegroupreadme)
2018-08-13T15:48:30.2656531Z ==============================================================================
2018-08-13T15:48:36.9603826Z *** 'DoNotDropObjectTypes' is not a valid argument for the 'Publish' action.
2018-08-13T15:48:37.2122455Z ##[error]System.Management.Automation.RuntimeException
2018-08-13T15:48:37.2249276Z ##[section]Finishing: Deploy using : dacpac
我还在发布配置文件中尝试过此操作,但没有在任务中设置其他参数:
<DropObjectsNotInSource>True</DropObjectsNotInSource>
<DoNotDropPermissions>True</DoNotDropPermissions>
<DoNotDropRoleMembership>True</DoNotDropRoleMembership>
<DoNotDropUsers>True</DoNotDropUsers>
但是SqlPackage仍然尝试删除它们:
Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission... Dropping Permission...