0
MSDeploy 작업을 통해 preSync/postSync 명령을 지정할 수 있습니까? 그렇지 않다면 어떻게해야합니까?MSDeploy 작업 및 presync
MSDeploy 작업을 통해 preSync/postSync 명령을 지정할 수 있습니까? 그렇지 않다면 어떻게해야합니까?MSDeploy 작업 및 presync
어떤 종류의 MSDeploy 작업을 사용하고 있습니까? msdeploy.exe의 Exec을 통과 한 경우 물론 그렇습니다. 물론 직접 지원하지 않는 래퍼라면 사전/사후 동기화가 실행되기 때문에 실행 명령 공급자와 동기화를 다시 호출하여 에뮬레이트 할 수 있습니다 try/catch/finally 구조 내에서 동기화를위한 또 다른 호출은 어쨌든 메인 동기화를 래핑합니다.
private int ExecuteWorker()
{
...
if (!this.HandleAuxillarySync("-preSync", this._commandLine._preSyncParameters, retbaseOptions2))
return -1;
DeploymentChangeSummary deploymentChangeSummary;
try
{
deploymentChangeSummary = @object.SyncTo(retproviderOptions2, retbaseOptions2, syncOptions);
}
...
finally
{
this.HandleAuxillarySync("-postSync", this._commandLine._postSyncParameters, retbaseOptions2);
}
this.HandleAuxillarySync("-postSyncOnSuccess", this._commandLine._postSyncOnSuccessParameters, retbaseOptions2);
...
private bool HandleAuxillarySync(string syncType, Dictionary<string, string> sourceParameters, DeploymentBaseOptions destBaseOptions)
{
...
try
{
using (DeploymentObject @object = DeploymentManager.CreateObject(retproviderOptions, retbaseOptions))
@object.SyncTo(destBaseOptions, syncOptions);
flag = true;
}
Microsoft.Web.Publishing.targets의 MSBuild 작업 MSDeploy를 사용하고 있습니다. –
그럴 경우 아니요, 별도의 동기를 조건부로 호출하고 exe 자체처럼 메인 동기화를 게시하십시오. –