[英]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提供程序...
IncludeSetAclProviderOnDestination=false
in your publish profile ...通过在发布配置文件中声明IncludeSetAclProviderOnDestination=false
将其添加到包中 /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.