My code is as follows:

...

propertyGroup1.AddProperty("DeployOnBuild", "true");
propertyGroup1.AddProperty("DeployTarget", "MSDeployPublish");
propertyGroup1.AddProperty("MSDeployServiceUrl", "localhost");
propertyGroup1.AddProperty("DeployIisAppPath", "local.projects.com");
propertyGroup1.AddProperty("MSDeployPublishMethod", "InProc");
propertyGroup1.AddProperty("AllowUntrustedCertificate", "true");

...

cSharpProject.ProjectCollection.RegisterLogger(cSharpLogger);
try {
      buildResult = cSharpProject.Build();
...

buildResult is set to false. However, it does not raise any error to the logger. And the project is not deployed.

I'm running my exe in Administrator mode.

Any help is apprecited.

Thanks

Chris hint: CSAutoParameterize.parameters and other subfolders have not been created.

有帮助吗?

解决方案

      <Target Name="WebPublish">
    <MsBuild Projects="MyProject.csproj" Properties="DeployOnBuild=true;DeployTarget=MSDeployPublish;MSDeployServiceUrl=localhost;DeployIisAppPath=local.website.com;MSDeployPublishMethod=RemoteAgent;AllowUntrustedCertificate=true;Username=someuser;password=somepassword" />
  </Target>

I was able to add this target to the project and call just that specific target.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top