Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Msbuild Project.Build不适用于DeployOnBuild=true_Msbuild_Microsoft.build - Fatal编程技术网

Msbuild Project.Build不适用于DeployOnBuild=true

Msbuild Project.Build不适用于DeployOnBuild=true,msbuild,microsoft.build,Msbuild,Microsoft.build,我的代码如下: ... propertyGroup1.AddProperty("DeployOnBuild", "true"); propertyGroup1.AddProperty("DeployTarget", "MSDeployPublish"); propertyGroup1.AddProperty("MSDeployServiceUrl", "localhost"); propertyGroup1.AddProperty("DeployIisAppPath", "local.proj

我的代码如下:

...

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
设置为
false
。但是,它不会给记录器带来任何错误。并且该项目未部署

我正在管理员模式下运行我的exe

感谢您的帮助

谢谢

克里斯 提示:
csautoparametrize。尚未创建参数和其他子文件夹。


      <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>
我能够将此目标添加到项目中,并仅调用该特定目标。


我能够将这个目标添加到项目中,并只调用那个特定的目标