1

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?

Laurence
  • 980
  • 12
  • 31
  • Which version of VS you installed on the build server? Is it the same version with your local PC? you may using the unsupported MSbuild version. – Andy Li-MSFT Sep 01 '18 at 07:35
  • On the build server there is Visual Studio Community 2017 plus Visual Studio Build Tools 2017. On my PC there is Visual Studio Professional 2017. – Laurence Sep 01 '18 at 07:52

1 Answers1

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

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • OK thanks very much, I will try this out on Monday. One thing - if I get TFS upgraded, should the DocFx Build Tasks extension be installed on the build server, or the TFS server (i.e. where the repository is maintained)? – Laurence Sep 01 '18 at 10:35
  • @Laurence You just need to install the extension on your TFS server by following the steps in this article :[Install extensions for Team Foundation Server (TFS)](https://docs.microsoft.com/en-us/vsts/marketplace/get-tfs-extensions?view=tfs-2018) , In short you can directory navigate to the extension manage page by this link `http://server:8080/tfs/_gallery/manage` --> Upload the extension (`*.VSIX` file) --> Right click and select Install.... After the extension installed to the specific collection, then you can create build definition and add the `Create DocFx Documentation` task from Utility – Andy Li-MSFT Sep 03 '18 at 01:31
  • I tested the suggestions in the answer: because I already had installed the Build Tools for Visual Studio 2017 on the build server, I found the MSBUILD version being used was 15.7.180 (the latest version): see [here](https://stackoverflow.com/a/48631783/248965) for Powershell script to get MSBUILD version. Also, TFS 2013 does not support installation of extensions as described. So .... it looks like the only option is to upgrade to TFS 2015 or higher. – Laurence Sep 03 '18 at 09:55