我正在使用带有 IIS 8 的 Windows Server 2012 RC(在 Windows Azure 上,新的 VM)。
我已经安装了 TeamCity 作为我的构建服务器。我从一切正常的当前安装迁移。
唯一不起作用的是针对 ASP.NET MVC 3 应用程序运行带有 Package 目标的 MSBuild。
MSBuild 日志的最后一部分,就在它必须实际创建包之前,如下所示:
[MyProject\MyProject.MvcClient\MyProject.MvcClient\MyProject.MvcClient.csproj] PipelinePreDeployCopyAllFilesToOneFolder
[21:46:16][PipelinePreDeployCopyAllFilesToOneFolder] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] Publish Pipeline Deploy phase Pre-Deploy CopyAllFilesToOneFolder Stage
[21:46:16][MyProject\MyProject.MvcClient\MyProject.MvcClient\MyProject.MvcClient.csproj] Package
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] Invoking Web Deploy to generate the package with the following settings:
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(LocalIisVersion) is 7
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(DestinationIisVersion) is 7
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(UseIis) is True
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IisUrl) is http://myproject.web
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IncludeIisSettings) is true
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(_DeploymentUseIis) is True
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(DestinationUseIis) is True
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IisUrl_SiteID) is 2
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IisUrl_SiteFriendlyName) is myproject.web
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IisUrl_SiteRelativePath) is /
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(IisServer_IisAppPoolName) is myproject.web
[21:46:16][Package] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] $(_Destination_IisServer_IisAppPoolName) is myproject.web
[21:46:16][Package] MakeDir
[21:46:16][MakeDir] Creating directory "F:\Workspace\DeployPackages\2012-07-11_09-45-53\".
[21:46:16][Package] CallTarget
[21:46:16][CallTarget] GenerateMsdeployManifestFiles
[21:46:16][GenerateMsdeployManifestFiles] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] Generate source manifest file for Web Deploy package/publish ...
[21:46:16][GenerateMsdeployManifestFiles] CallTarget
[21:46:16][CallTarget] CollectDatabasesToPublish
[21:46:16][CollectDatabasesToPublish] MakeDir
[21:46:16][MakeDir] Creating directory "obj\Release\Database".
[21:46:16][CallTarget] PackageUsingManifest
[21:46:16][PackageUsingManifest] GetPublishingLocalizedString
[21:46:16][GetPublishingLocalizedString] Packaging into F:\Workspace\DeployPackages\2012-07-11_09-45-53\MyProject.msbuild.zip.
[21:46:16][PackageUsingManifest] VSMSDeploy
[21:46:16][VSMSDeploy] Starting Web deployment task from source:manifest(F:\Workspace\DeployPackages\2012-07-11_09-45-53\MyProject.msbuild.SourceManifest.xml) to Destination:package(F:\Workspace\DeployPackages\2012-07-11_09-45-53\MyProject.msbuild.zip).
[21:46:16][VSMSDeploy] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009, 5): Web deployment task failed. (There was an error reading IIS configuration schema from 'C:\Windows\system32\inetsrv\config\schema\'.)
[21:46:16][VSMSDeploy] Package failed.
[21:46:16][MyProject\MyProject.MvcClient\MyProject.MvcClient\MyProject.MvcClient.csproj] Project MyProject\MyProject.MvcClient\MyProject.MvcClient\MyProject.MvcClient.csproj failed.
[21:46:16][MyProject\MyProject.msbuild.teamcity] Project MyProject\MyProject.msbuild.teamcity failed.
[21:46:16]Process exited with code 1
实际的错误信息是这样的:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3009, 5): Web deployment task failed. (There was an error reading IIS configuration schema from 'C:\Windows\system32\inetsrv\config\schema\'.)
首先,我尝试以管理员身份运行构建代理,因为我认为这可能与安全相关。那没有帮助。
然后我尝试在服务器上安装 Web Deploy 3.0。也没有运气。
我能做但真的不想做的最后一件事是从项目文件中删除 IIS 设置。
有任何想法吗?