找到How do I configure MSBuild to use a saved publishProfile for WebDeploy?之后,我在我的Web应用程序中设置了一个发布配置文件,如果我使用VS2013的开发人员命令提示符使用msbuild.exe,它将预编译Web应用程序
msbuild.exe WebSite.csproj /p:DeployOnBuild=true /p:PublishProfile=TfsPrecompile
发布名为TfsPrecompile的配置文件,在https://stackoverflow.com/a/13267694/595473的帮助下
<?xml version="1.0" enCoding="utf-8"?><Project Toolsversion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>fileSystem</WebPublishMethod> <LastUsedBuildConfiguration>DeBUG</LastUsedBuildConfiguration> <LastUsedplatform>Any cpu</LastUsedplatform> <SiteUrlTolaunchAfterPublish /> <ExcludeApp_Data>False</ExcludeApp_Data> <PublishUrl>$(MSBuildProjectDirectory)\PublishDirectory</PublishUrl> <DeleteExistingfiles>True</DeleteExistingfiles> <PrecompileBeforePublish>True</PrecompileBeforePublish> <Enableupdateable>False</Enableupdateable> <DeBUGSymbols>False</DeBUGSymbols> <WDPMergeOption>DonotMerge</WDPMergeOption> </PropertyGroup></Project>
在本地运行MSBuild,我最终在新的PublishDirectory文件夹中使用预编译的站点,并且所有内容似乎都很顺利.
要链接TFS和发布管理,我使用的是ReleaseTfvcTemplate.12.xaml模板.
构建>项目:$/ Insert_Directory_Here / WebSite.csproj
高级> MSBuild参数:/ p:DeployOnBuild = true / p:PublishProfile = TfsPrecompile
当我使用MSBuild参数运行构建时,与没有预编译参数的构建相比,九分钟构建中没有显着的时间差异.当我在本地运行MSBuild时,我看到对ASPNETCOMPILER的引用滚动,虽然我在任何TFS诊断日志中都没有看到对ASPNETCOMPILER或aspnet_compiler的引用.
解决方法 原来,构建框没有执行发布所需的所有目标,所以它只是忽略它.从https://social.msdn.microsoft.com/Forums/vstudio/en-US/c2d10c74-ed44-4635-acb9-ab08612701e2/deployonbuild-not-working?forum=tfsbuild回答
总结Finally! I have the solution. Whether deploying from Team Build or you are using MSBuild directly you will need to copy the MSBuild targets onto your build machine in order for publishing to succeed.
We do not install Visual Studio onto our build machine (waste of a license) – however we do install the Visual Studio Shell. It seems the shell installs some of the MSBuild targets – but not all – and certainly not Publishing.
Therefore on a machine with VS installed go to C:\Program files (x86)\MSBuild\Microsoft
copy this entire folder to your build machine and replace the same folder there. Maybe back up the original first. You Could also probably figure out exactly which targets you actually need…
This fixed it for me!
以上是内存溢出为你收集整理的如何使用已保存的发布配置文件获取TFS构建以预编译Web应用程序?全部内容,希望文章能够帮你解决如何使用已保存的发布配置文件获取TFS构建以预编译Web应用程序?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)