问题
I am struggling to set up a continuous deployment process for a DocFX project, using on-premises TFS.
The process is described here, however the example walk-through is for VSTS, and I have on-premises TFS (version 2013). The basic idea is to build and deploy the documentation website on every checkin. The DocFx Build Tasks extension that the process uses does appear to support on-premises TFS ... I just can't see how to get it working!
I have a VS solution containing a single C# project which has a Nuget reference to docfx.console version 2.38.1 (the latest). When I build in VS on my local PC, the _sites folder is populated with the HTML correctly. However, when built on a build server, the build fails with 'warning MSB4078: The project file "DocFx.csproj" is not supported by MSBuild and cannot be built.'
So then I discovered the DocFx Build Tasks extension and it looked like it might solve my issue.
I have downloaded the .VSIX, but cannot figure out where & how to install it.
If I run it directly on the build server (or my local PC) the error "This extension is not installable on any currently installed products." appears. This is from the install log:
31/08/2018 14:31:54 - Supported Products :
31/08/2018 14:31:54 - Microsoft.VisualStudio.Services
31/08/2018 14:31:54 - Version :
31/08/2018 14:31:54 -
31/08/2018 14:31:54 - References :
31/08/2018 14:31:54 - Signature Details...
31/08/2018 14:31:54 - Extension is not signed.
31/08/2018 14:31:54 -
31/08/2018 14:31:54 - Searching for applicable products...
31/08/2018 14:31:54 - Found installed product - Microsoft Visual Studio 2012 Shell (Integrated)
31/08/2018 14:31:54 - Found installed product - Global Location
31/08/2018 14:31:54 - Found installed product - ssms
31/08/2018 14:31:54 - Found installed product - Visual Studio Community 2017
31/08/2018 14:31:54 - Found installed product - Visual Studio Build Tools 2017 (2)
31/08/2018 14:31:54 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
There also seems to be no option I can see in the TFS 2013 portal to upload an extension (although later versions seem to have this).
What do I have to do?
回答1:
Based on the error message "'warning MSB4078: The project file "DocFx.csproj" is not supported by MSBuild and cannot be built.
'" Seems you are using the incorrect version of MSBuild to build the project. Reference similar thread : Build succeeded with projects Ctrl + Shift + B that MSBuild can't build
For the TFS 2013 + VS 2017 combination, you may need to changed the ToolPath
to the full MSBuild path :"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
. Reference this thread: TFS 2013 and Visual Studio 2017 Syntax
Besides, you can also try specify the MSBuild arguments
in the build definition. such as: /tv:15.0 /p:VisualStudioVersion=15.0
to build with VS2017.
The DocFx Build Tasks extension is not supported in TFS 2013. To use the extension you need migrating to vNext build (TFS 2015 and later version). To install extension please see Install extensions for Team Foundation Server (TFS).
Suggest you migrating to the modern version of TFS (vNext build system). See Why You Should Switch to Build VNext
来源:https://stackoverflow.com/questions/52119519/continuous-deployment-of-docfx-documentation-using-on-premises-tfs