MsDeploy虚拟目录在部署时转换为虚拟应用程序 [英] MsDeploy Virtual Directory gets converted to Virtual Application on deploy
问题描述
为了使CMS正常工作,需要将其部署到www根下的虚拟目录,以便它可以访问(通过反映)网站来管理(注意:CMS = N2CMS)。当使用Visual Studio'发布到Web'一切都很好。但是当我通过msbuild命令行生成包并发布该版本时,我的虚拟目录转换为虚拟应用程序。
我配置了远程服务器, n2'在我的IIS Web应用程序('exampleapp')下面,并在Visual Studio中的项目中的包/发布Web设置( IIS网站/应用程序名称在目标服务器上使用)配置此路径。
要生成部署包:
msbuild.exe myproject。 csproj / T:Package
这将生成我的代码的压缩包以及MsDeploy命令行批处理文件(标准msbuild / msdeploy目标)。
生成的 SetParameters.xml 包含以下内容:
code><?xml version =1.0encoding =utf-8?>
< parameters>
< setParameter name =IIS Web Application Namevalue =exampleapp / n2/>
< / parameters>
生成的SourceManifest.xml 包含以下
<?xml version =1.0encoding =utf-8?&
< sitemanifest>
< IisApp path =C:\ ... simplified-path ... \PackageTmpmanagedRuntimeVersion =v4.0/>
< setAcl path =C:\ ... shortened-path ... \PackageTmpsetAclResourceType =Directory/>
< setAcl path =C:\ ... simplified-path ... \PackageTmpsetAclUser =anonymousAuthenticationUsersetAclResourceType =Directory/>
< / sitemanifest>任何人都有一个线索为什么虚拟目录转换为虚拟应用程序?
$ b b 解决方案在Microsoft.Web.Publishing.targets文件中,DeployAsIisApp默认为true:
< ; DeployAsIisApp Condition ='$(DeployAsIisApp)'==''> true< / DeployAsIisApp>
您应该能够将其覆盖为false到项目文件中的相应PropertyGroup元素或项目文件夹中的.wpp.targets文件;编辑项目文件,请参阅
http://msdn.microsoft.com/en-us/library/ff398069.aspx
For my CMS to work properly it needs to be deployed to a virtual directory underneath the www root so it can access (via reflection) the website to manage (note: CMS = N2CMS). When using Visual Studio 'Publish To Web' all is fine. But when I generate the package via msbuild commandline and publish that version my virtual directory is converted to a virtual application.
I configured my remote server to have a virtual directory '/n2' underneath my IIS web application ('exampleapp') and configured this path in the Package/Publish Web settings (IIS Website/Application name to use on the destination server) within my project in Visual Studio.
To generate the deploy package:
msbuild.exe myproject.csproj /T:Package
This generates the zipped package of my code together with MsDeploy commandline batch files to execute (standard msbuild/msdeploy target).
The generated SetParameters.xml contains the following:
<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="exampleapp/n2" />
</parameters>
The generated SourceManifest.xml contains the following
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<IisApp path="C:\...shortened-path...\PackageTmp" managedRuntimeVersion="v4.0" />
<setAcl path="C:\...shortened-path...\PackageTmp" setAclResourceType="Directory" />
<setAcl path="C:\...shortened-path...\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
</sitemanifest>
Anybody got a clue why the virtual directory gets converted to virtual application?
解决方案 In the Microsoft.Web.Publishing.targets file, DeployAsIisApp defaults to true:
<DeployAsIisApp Condition="'$(DeployAsIisApp)'==''">true</DeployAsIisApp>
You should be able to override it to false by adding it to the appropriate PropertyGroup element in the project file or in a .wpp.targets file in the project folder; on editing the project file, see
http://msdn.microsoft.com/en-us/library/ff398069.aspx
这篇关于MsDeploy虚拟目录在部署时转换为虚拟应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!