我正在尝试通过 c# 使用 MSDeploy API 运行远程 MSDeploy 命令。
我正在运行以下内容:
//test connection by pulling down file list
var sourceBaseOptions = new DeploymentBaseOptions();
var destBaseOptions = new DeploymentBaseOptions
{
ComputerName = "https://mysite.com/msdeploy.axd?sitename=siteName",
UserName = "username",
Password = "password",
AuthenticationType = "Basic"
};
var syncOptions = new DeploymentSyncOptions();
var deployment = DeploymentManager.AvailableProviderFactories;
DeploymentObject deploymentObject = DeploymentManager.CreateObject("dirPath", Settings.TemporaryStoragePath, sourceBaseOptions);
// collect and report all the changes that would happen
var changes = deploymentObject.SyncTo(destBaseOptions, syncOptions);
当我运行不受信任的证书时,它会引发异常。我如何告诉 MSDeploy 不要担心证书?(即基于代码的“AllowUntrustedCertificate=true”)