我们如何在共享主机上从TFS部署到IIS? (去吧爸爸)

时间:2018-02-25 02:40:02

标签: iis tfs msbuild shared-hosting tfs2018

找到的文档here描述了如何部署到IIS,但WinRM组件需要本地管理员权限。显然,这与GoDaddy等服务提供商的共享托管无法实现。 (出于本次讨论的目的,我们将排除Azure目标。)

Visual Studio只需使用导入的.publishsettings文件即可轻松完成此操作。是否有理由认为TFS应该能够在不需要额外权限的情况下做同样的事情?

...或者在尝试使用TFS发布到非Azure共享主机配置时,我们是否运气不好?

- 编辑 -

我一直在研究帕特里克建议的答案,经过无数种配置组合后,我仍然空洞。 MSBuild确实看起来像这样,是的,但是我不能让它在我的TFS 2018上工作。

发布任务的输出如下。我们可以看到,MSBuild拒绝将网站发布到我的本地测试IIS。

奇怪的是,MSBuild在我从本地工作站的命令窗口运行以下日志中的命令时按预期发布(当然,在调整相关文件路径之后,删除{{ 1}}开关)。

我尝试过的一件事是编辑/删除源/目标上的文件,尝试强制同步。这也不起作用。

有没有人看到任何迹象表明这为什么不起作用?

日志

/dl:CentralLogger

QA.pubxml

2018-02-27T04:48:38.4708105Z ##[section]Starting: Build solution $(System.DefaultWorkingDirectory)/Website/drop/Website.vbproj
2018-02-27T04:48:38.4938123Z ==============================================================================
2018-02-27T04:48:38.4938123Z Task         : Visual Studio Build
2018-02-27T04:48:38.4938123Z Description  : Build with MSBuild and set the Visual Studio version property
2018-02-27T04:48:38.4938123Z Version      : 1.120.0
2018-02-27T04:48:38.4938123Z Author       : Microsoft Corporation
2018-02-27T04:48:38.4938123Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
2018-02-27T04:48:38.4938123Z ==============================================================================
2018-02-27T04:48:41.0024890Z ##[command]"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2018-02-27T04:48:41.7115427Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" /nologo /nr:false /dl:CentralLogger,"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=6e6502d0-9bea-46af-a5a7-9dac551b9e29|SolutionDir=D:\Agent\_work\r5\a\Website\drop"*ForwardingLogger,"D:\Agent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:AllowUntrustedCertificate=true /p:PublishProfile="D:\Agent\_work\r5\a\Website\drop\My Project\PublishProfiles\QA.pubxml" /p:Password=******** /p:platform="AnyCPU" /p:configuration="release" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="TFS_1c911c00-1ecd-4ca9-87b0-d8d34f8c59c4_release_2_24_24_1"
2018-02-27T04:48:42.3456044Z Build started 2/26/2018 7:48:42 PM.
2018-02-27T04:48:44.0457237Z Project "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" on node 1 (default targets).
2018-02-27T04:48:44.0487239Z CoreResGen:
2018-02-27T04:48:44.0487239Z   No resources are out of date with respect to their source files. Skipping resource generation.
2018-02-27T04:48:44.2587401Z CoreCompile:
2018-02-27T04:48:44.2597397Z   C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\vbc.exe /noconfig /imports:Intexx,Intexx.Linq,Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.ComponentModel,System.Data,System.Data.Common,System.Data.Entity,System.Data.Entity.Migrations,System.Data.SqlClient,System.IO,System.Linq,System.Xml.Linq,System.Diagnostics,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /optioncompare:Binary /optionexplicit+ /optionstrict:custom /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /optioninfer+ /nostdlib /rootnamespace:Website /sdkpath:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7" /highentropyva+ /doc:obj\release\Website.xml /define:"CONFIG=\"release\",TRACE=-1,_MyType=\"Custom\",PLATFORM=\"AnyCPU\"" /reference:D:\Agent\_work\r5\a\Website\drop\bin\EntityFramework.dll,D:\Agent\_work\r5\a\Website\drop\bin\EntityFramework.SqlServer.dll,D:\Agent\_work\r5\a\Website\drop\bin\Intexx.Core.dll,D:\Agent\_work\r5\a\Website\drop\bin\itxcorlib.dll,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.ComponentModel.DataAnnotations.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Configuration.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Core.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Data.DataSetExtensions.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Data.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Drawing.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.EnterpriseServices.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.ApplicationServices.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.DynamicData.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Entity.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Extensions.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.Services.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Xml.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Xml.Linq.dll" /debug+ /debug:pdbonly /optimize+ /out:obj\release\Website.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /resource:obj\release\Website.Migrations._001.resources /resource:obj\release\Website.Resources.resources /target:library /utf8output App_Code\Enums.vb Bill.aspx.designer.vb Bill.aspx.vb Contact.aspx.designer.vb Contact.aspx.vb Default.aspx.designer.vb Default.aspx.vb Defects.aspx.designer.vb Defects.aspx.vb Donate.aspx.designer.vb Donate.aspx.vb Forum.aspx.designer.vb Forum.aspx.vb Jackson.aspx.designer.vb Jackson.aspx.vb Key.aspx.designer.vb Key.aspx.vb Laws.aspx.designer.vb Laws.aspx.vb Letters.aspx.designer.vb Letters.aspx.vb Losers.aspx.designer.vb Losers.aspx.vb Main.Master.designer.vb Main.Master.vb MenuItem.ascx.designer.vb MenuItem.ascx.vb Migrations\201802040108464_001.Designer.vb Migrations\201802040108464_001.vb Migrations\Configuration.vb Migrations\Defaults.vb Models\Db\Context.vb Models\Db\Loser.vb Models\Db\NewsItem.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\MyExtensions\MyWebExtension.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" News.aspx.designer.vb News.aspx.vb Oops.aspx.designer.vb Oops.aspx.vb Pocket.aspx.designer.vb Pocket.aspx.vb Seventeenth.aspx.designer.vb Seventeenth.aspx.vb States.aspx.designer.vb States.aspx.vb Store.aspx.designer.vb Store.aspx.vb "D:\Agent\_work\_temp\.NETFramework,Version=v4.7.AssemblyAttributes.vb"
2018-02-27T04:48:44.2917430Z   Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn
2018-02-27T04:48:44.5307644Z   
2018-02-27T04:48:44.5357653Z _CopyFilesMarkedCopyLocal:
2018-02-27T04:48:44.5357653Z   Touching "D:\Agent\_work\r5\a\Website\drop\obj\release\Website.vbproj.CopyComplete".
2018-02-27T04:48:44.5567658Z CopyFilesToOutputDirectory:
2018-02-27T04:48:44.5577603Z   Copying file from "obj\release\Website.dll" to "bin\Website.dll".
2018-02-27T04:48:44.5587611Z   Website -> D:\Agent\_work\r5\a\Website\drop\bin\Website.dll
2018-02-27T04:48:44.5597611Z   Copying file from "obj\release\Website.pdb" to "bin\Website.pdb".
2018-02-27T04:48:44.5607636Z   Copying file from "obj\release\Website.xml" to "bin\Website.xml".
2018-02-27T04:48:44.5967639Z Done Building Project "D:\Agent\_work\r5\a\Website\drop\Website.vbproj" (default targets).
2018-02-27T04:48:44.6257666Z 
2018-02-27T04:48:44.6257666Z Build succeeded.
2018-02-27T04:48:44.6257666Z     0 Warning(s)
2018-02-27T04:48:44.6257666Z     0 Error(s)
2018-02-27T04:48:44.6257666Z 
2018-02-27T04:48:44.6257666Z Time Elapsed 00:00:02.29
2018-02-27T04:48:44.6868621Z ##[section]Finishing: Build solution $(System.DefaultWorkingDirectory)/Website/drop/Website.vbproj

2 个答案:

答案 0 :(得分:0)

与Azure不同,设置从VSTS / TFS到这些定价托管服务器的持续部署没有内置解决方案。

这是双向问题,TFS也迎接其他平台提供其官方扩展作为市场中的三方任务。您可以在其网站中提交用户声音。

作为一种解决方法,TFS还在构建代理中使用MSBuild来执行构建。 .publishsettings也与Azure有关。如果您可以通过Visual Studio在本地使用Web Deploy与GoDaddy。它也应该能够在TFS中完成。

使用下面的MSBuild Argument:

查看本教程
/p:DeployOnBuild=true /p:PublishProfile="sitename.com - Web Deploy.pubxml" /p:AllowUntrustedCertificate=true /p:UserName="uname" /p:Password="password" /p:VisualStudioVersion=14.0

enter image description here

更多详情请参阅本教程:HOW TO SETUP VSTS CONTINUOUS DEPLOYMENT FOR GODADDY

但是根据这个discussion,似乎甚至直接使用Visual Studio Web Deploy来处理GoDaddy也不是那么稳定。如果你遇到同样的问题,你可以处理他们的支持。

答案 1 :(得分:0)

事实证明,我没有在服务器上安装完整的VS工具集。我只安装了最低限度,因为我不需要VSTest功能。

这次我更新并安装了Web和桌面,并且部署顺利通过。

致信Microsoft支持服务以帮助我解决此问题。

相关问题