简体   繁体   English

Visual Studio用于生成msdeploy包的清单

[英]What manifest visual studio is using to generate msdeploy package

I want to package a folder with msdeploy.exe to a zip destination at the end of CI process. 我想在CI过程结束时将带有msdeploy.exe的文件夹打包到zip目标。 I run the following command line 我运行以下命令行

msdeploy.exe -verb:sync -source:contentpath="C:\SampleWebApp" -dest:package="c:\SampleWebApp.zip" -declareParamFile="parameters.xml" 

I also like the *.deploy.cmd and *.SetParameters.xml which msbuild generates when it spits out a deployment package. 我也喜欢msbuild在吐出部署包时生成的* .deploy.cmd和* .SetParameters.xml。 I renamed the one set of *.deploy.cmd and *.SetParameters.xml file and changed the content accordingly. 我重命名了一组* .deploy.cmd和* .SetParameters.xml文件并相应地更改了内容。 to be able to run in deployment environment. 能够在部署环境中运行。

When I run *.deploy.cmd file it generates the folder "C:\\SampleWebApp" rather than creating the iis app based on parameters provided in .SetParameter.xml. 当我运行* .deploy.cmd文件时,它会生成文件夹“C:\\ SampleWebApp”,而不是根据.SetParameter.xml中提供的参数创建iis应用程序。

After some investigation, I've found that the .cmd deploys to -dest:auto which is good. 经过一番调查,我发现.cmd部署到-dest:auto这很好。 but apparently my package manifest inside the package indicates that this package is contentPath whereas packages generated by msbuild has more complex manifest in archive.xml inside package using iisApp provider. 但显然我的包清单显示在包中指示此包是contentPath,而msbuild生成的包在使用iisApp提供程序的包内的archive.xml中有更复杂的清单。

Having looked at following post 看了下面的帖子

http://blogs.msdn.com/b/webdev/archive/2013/01/09/real-scenario-folder-deployment-scenarios-with-msdeploy.aspx http://blogs.msdn.com/b/webdev/archive/2013/01/09/real-scenario-folder-deployment-scenarios-with-msdeploy.aspx

I believe if I use -source:manifest="Package.xml" with right Package.xml the end result should be similar to VS package output 我相信如果我使用-source:manifest =“Package.xml”和正确的Package.xml,最终结果应该类似于VS包输出

The I thought maybe the *.SourceManifest.xml is the manifest for the package. 我想也许* .SourceManifest.xml是包的清单。 I used and it builds the package but when I want to deploy that to the using .deploy.cmd it complains about setAclUser 我使用它并构建包但当我想将它部署到使用.deploy.cmd时它会抱怨setAclUser

Error: A value for the 'setAclUser' setting must be specified when the 'setAcl' provider is used with a physical path. 错误:当'setAcl'提供程序与物理路径一起使用时,必须指定'setAclUser'设置的值。

Does anybody know that is the manifest msbuild uses? 有人知道这是msbuild使用的清单吗?

To directly answer your question: the manifest is generated dynamically based on MsDeploySourceManifest MSBuild items. 直接回答您的问题:清单是基于MsDeploySourceManifest MSBuild项动态生成的。

You can make it use contentPath rather than iisApp by declaring DeployAsIisApp=false in your publish profile (or command line /p:DeployAsIisApp=false ). 您可以通过在发布配置文件中声明DeployAsIisApp=false (或命令行/p:DeployAsIisApp=false )来使用contentPath而不是iisApp This will also disable the setAcl providers. 这也将禁用setAcl提供程序。

If you want to keep iisApp , you can disable the ACL providers... 如果要保留iisApp ,可以禁用ACL提供程序...

  1. ... being added to the package by declaring IncludeSetAclProviderOnDestination=false in your publish profile ...通过在发布配置文件中声明IncludeSetAclProviderOnDestination=false将其添加到包中
  2. ... being deployed by passing /I:False to deploy.cmd ...通过传递/I:False部署/I:False部署deploy.cmd

Following is the manifest template 以下是清单模板

<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
  <iisApp path="[PATH1]"/>
</sitemanifest>

and Parameter.xml template 和Parameter.xml模板

<parameters>
  <parameter name="IIS Web Application Name" defaultValue="WEBSITENAME" tags="IisApp">
    <parameterEntry kind="ProviderPath" scope="IisApp" match="^[PATH1ESCAPED]$" />
  </parameter>
  <!-- appSetting section-->
</parameters>

note: [PATH1] should be replaced with your folder path like C:\\MY.FOLDER\\WWW and [PATH1ESCAPED] should be same path but escaped with postfix and prefix ^ $ like ^C:\\MY.FOLDER\\WWW$ 注意:[PATH1]应替换为您的文件夹路径,如C:\\ MY.FOLDER \\ WWW和[PATH1ESCAPED]应该是相同的路径,但使用后缀和前缀^ $转义,如^ C:\\ MY.FOLDER \\ WWW $

Then you can call 然后你可以打电话

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:manifest="Manifest.xml" -dest:package=%1 -declareParamFile="parameters.xml" 

and %1 being folder path like C:\\MY.FOLDER\\WWW 和%1是文件夹路径,如C:\\ MY.FOLDER \\ WWW

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用MsBuild生成自定义的MsDeploy清单(包目标) - Using MsBuild to generate customized MsDeploy manifest (Package target) MSDeploy-使用清单同步到远程文件夹 - MSDeploy - Synchronizing to a remote folder using a manifest 如何使用 Qt 中的应用程序清单生成 Visual Studio 项目? - How to generate a Visual Studio project with app manifest from Qt? Visual Studio 2005 - C++ - 什么控制清单创建 - Visual Studio 2005 - C++ - What controls the manifest creation Visual Studio的条件清单文件 - Conditional Manifest File for Visual Studio 如何使用我自己的清单文件并使用Visual Studio 2017将其嵌入到可执行文件中? - How to use my own manifest file and embed it into executable using Visual Studio 2017? / MANIFEST Visual Studio 2013中的默认值 - /MANIFEST default value in Visual Studio 2013 Visual Studio C#清单找不到文件 - Visual Studio C# Manifest not finding files 在Visual Studio中使用清单文件指定正确的VS 2012 VC / MFC运行时 - Specifying Correct VS 2012 VC/MFC Runtime Using Manifest Files in Visual Studio 如何在Visual Studio 2010中使用清单文件选项禁用UAC提示 - How to disable UAC prompt using manifest file option in Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM