0
votes

After adding MSBuild arguments: /tv:14.0 /p:VisualStudioVersion=14

I get the following error message:

C:\Builds\10\IW_*****\Dev\src\Sites\******\Properties\CompileLicxFiles_Patched.targets (98): The "LC" task was not given a value for the required parameter "TargetFrameworkVersion".

I'm trying to build using VS2015 (TFS2013 server)

Found this: https://connect.microsoft.com/VisualStudio/feedback/details/1406942/new-required-lc-task-parameter-targetframeworkversion However, I've checked and all projects in the solution have 4.5.2 version assigned.

Log (it seems it's still using VS2013):

Added package 'NEST.1.9.1' to folder ...
Added package 'FluentAssertions.4.17.0'....
...
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\10\IW_****\Dev\src\Solution123.All.sln" /nr:False /fl
3
/p:VisualStudioVersion=1 are you sure 1 is correct?stijn
Could you share your build definition? At which step did you get error "The "LC" task was not given a value for the required parameter"?Cece Dong - MSFT

3 Answers

0
votes

To use VS 2015, the argument should be /p:VisualStudioVersion=14.0.

0
votes

First thing first. I was using VS2015 to edit TfvcTemplate.12.xaml build template which cased issues. For some reason, when using VS2015 - it was modifying the xaml document incorrectly. To make any type of changes to TfvcTemplate.12.xaml template you have to use VS2013!

TfvcTemplate.12.xaml does not contain "ToolPath" variable. To make this work I simply added "14.0" (quotes necessary) under "ToolVersion"

TFS2013 will use VS2015 MSBuild to run the build. No need for MSBuild command line switches. Works without them.

Output log:

Run MSBuild00:13:39 C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe restore "C:\Builds\9************\packageRestore.proj" -NonInteractive MSBuild

auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.

enter image description here

0
votes

You could also just modify your build definition with Visual Studio. On the process tab of the build definition that uses TfvcTemplate.12.xaml expand 2.5 section to see the MSBuild arguments. Add the below arguments to the build definition and save it. I assume your problem was you had /p:VisualStudioVersion=14 instead of /p:VisualStudioVersion=14.0.

 /p:VisualStudioVersion=14.0 /tv:14.0