Bug 55889 - Unable to build a project with /tv:14.0 with msbuild
Summary: Unable to build a project with /tv:14.0 with msbuild
Alias: None
Product: Tools
Classification: Mono
Component: msbuild ()
Version: 5.0 (2017-02)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Ankit Jain
Depends on:
Reported: 2017-05-02 19:08 UTC by Peter Collins
Modified: 2017-05-03 22:52 UTC (History)
1 user (show)

Is this bug a regression?: No
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Peter Collins 2017-05-02 19:08:46 UTC
I'm seeing the following error when trying to build a simple .net console project with msbuild:

>   /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets(61,3): error MSB4062: The "Microsoft.Build.Tasks.Csc" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
>  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
## Steps to reproduce ##
1. msbuild /t:Build *.csproj /tv:14.0

## Supplemental Info ##
Log File #1:	http://xqa.blob.core.windows.net/gist/log-7c305a39b2774542b81120559617dbfd.txt

## Environment ##
Comment 1 Ankit Jain 2017-05-03 22:52:33 UTC
This is not supported with msbuild. For explicitly using older tools version, xbuild must be used. If an older ToolsVersion is specified in a project file, then that gets ignored and the latest(15.0) is always used.

This[1] now errors out if a older tools version is used with `/tv:`.

1. https://github.com/mono/msbuild/commit/5c7ae380530ea3d06f64014b51bcc6bc326a8561