我有一个奇怪的问题,其中一个构建无法创建其他类似构建正在创建的Web部署包。我正在运行TFS 2013.2,我的所有客户端都是VS2013.2。构建服务器也是TFS 2013.2。 Web应用程序是.NET 4.5.1。
该解决方案的目的是使用Web部署(发布配置文件)构建和部署两个Web应用程序。第一个应用程序编译和部署就好了。第二个失败的非常奇怪。
我认为正在进行的要点是构建服务正在将源文件复制到要压缩的临时位置。这是日志中的一个块:
CopyAllFilesToSingleFolderForPackage:
Creating directory "obj\Development\Package\PackageTmp".
Copying all files to temporary location below for package/publish:
obj\Development\Package\PackageTmp.
Copying Scripts\path\production\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\production\Constants.js.
Copying Scripts\path\production\Directives.js to obj\Development\Package\PackageTmp\Scripts\path\production\Directives.js.
Copying Scripts\path\production\ProductModule.js to obj\Development\Package\PackageTmp\Scripts\path\production\ProductModule.js.
Copying Scripts\path\production\Controllers.js to obj\Development\Package\PackageTmp\Scripts\path\production\Controllers.js.
Copying Scripts\path\production\Models.js to obj\Development\Package\PackageTmp\Scripts\path\production\Models.js.
Copying Scripts\path\production\Services.js to obj\Development\Package\PackageTmp\Scripts\path\production\Services.js.
Copying Scripts\path\path3\path3Controller.js to obj\Development\Package\PackageTmp\Scripts\path\path3\path3Controller.js.
Copying Scripts\path\path3\path3Module.js to obj\Development\Package\PackageTmp\Scripts\path\path3\path3Module.js.
Copying Scripts\path\path3\Directives.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Directives.js.
Copying Scripts\path\path3\Filters.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Filters.js.
Copying Scripts\path\path3\DetailController.js to obj\Development\Package\PackageTmp\Scripts\path\path3\DetailController.js.
Copying Scripts\path\path3\ListController.js to obj\Development\Package\PackageTmp\Scripts\path\path3\ListController.js.
Copying Scripts\path\path3\Models.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Models.js.
Copying Scripts\path\path3\Services.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Services.js.
CleanWebsitesWPPAllFilesInSingleFolder:
Removing directory "obj\Development\Package\PackageTmp".
您可以看到它从源复制到某个临时目录。在它之后,它会完成删除该目录。
然后,它会执行许多其他操作,例如
ValidateGlobalPackageSetting
CollectFilesFromIntermediateAssembly
CollectFilesFromContent
CollectFilesFromIntermediateSatelliteAssembliesWithTargetPath
CollectFilesFromReference
CollectFilesFromAllExtraReferenceFiles
CollectFilesFrom_binDeployableAssemblies
PipelineCollectFilesPhase
PreTransformWebConfig
TransformWebConfigCore
PostTransformWebConfig
PreProfileTransformWebConfig
PipelineTransformPhase
GetMSDeployInstalledVersionPath
ProcessPublishDatabaseSettings
PreAutoParameterizationWebConfigConnectionStrings
AutoParameterizationWebConfigConnectionStringsCore
PostAutoParameterizationWebConfigConnectionStrings
PipelineMsdeploySpecificTransformPhase
GenerateGlobalPublishSetting
然后我们到达了这个时候想要创建真实发布包的地方
CopyAllFilesToSingleFolderForMsdeploy
Creating directory "obj\Development\Package\PackageTmp".
Copying all files to temporary location below for package/publish:
obj\Development\Package\PackageTmp.
Copying obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(2660,5): error : Copying file obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js failed. Could not find file 'obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js'. [D:\Builds\1\path.Web\Portal_Dev\Sources\Portal\Trunk\Code\path.Portal\path.Portal.Web\path.Portal.Web.csproj]
Done Building Project "D:\Builds\1\path.Web\Portal_Dev\Sources\Portal\Trunk\Code\path.Portal\path.Portal.Web\path.Portal.Web.csproj" (default targets) -- FAILED.
奇怪的是,它不是从源头复制的。它试图从临时位置复制。首先,临时位置已被清除。其次,从obj \ Package复制到onj \ Package而不是从Scripts \复制到onj \ Package
根本没有任何意义。这是我正在使用的msdeploy参数。它在几个不同的版本上工作。
/p:DeployOnBuild=true;PublishProfile=Development;DeployTarget=MSDeployPublish;MSDeployPublishMethod=RemoteAgent;MsDeployServiceUrl=http://someServer:9090;SkipExtraFilesOnServer=true;username=
我的构建模板有点陈旧,但我没有遇到任何其他构建或部署的问题。
我知道我应该提供的东西可能更多。请让我知道我还可以添加什么来帮助解决问题
编辑:我在标题中提到了打字稿。它试图复制的所有文件都是从Typescript生成的JS文件。他们都正确设置了构建操作。另一个我们在这个解决方案中的应用程序项目根本没有打字稿,并且构建和部署都很好。另外值得一提的是,如果我使用命令行参数中指定的配置文件从visual studio手动发布,那么一切都可以正常部署。
答案 0 :(得分:0)
我将构建模板更改为最新模板,并且工作正常。我丢失了所有自定义设置,但这指向我的构建模板导致问题