9

I try to publish project to my file directory.

I take a this message. But do not shown any error. Error list is empyty.

2> Building with tools version "14.0".

2> Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="14.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=293424. 2> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully. 2>Done building project "project_name.csproj" – FAILED. 2> ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

TesterG
  • 91
  • 1
  • 1
  • 4
  • This question similar to this question https://stackoverflow.com/questions/42103232/vs2015-how-to-build-using-msbuild-12-0 – Başar Kaya Jan 17 '18 at 08:53
  • @TesterG, Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Jan 19 '18 at 04:59
  • Unfortunately, I could not try this method. But I found other method. But I could not try this method too. You can try this method. I suggest other method to you. https://stackoverflow.com/questions/20886391/vs-2012-project-failed-to-build-because-of-missing-toolset – TesterG Jan 19 '18 at 07:13
  • @TesterG, Why could not you try this method? If you worry about any modification destroy your project, you can back up it. Then just modify the Toolversion from 12.0 to 14.0 in the .csproj file. What you provide is same as mine, just change 12.0 to 4.0, but you are using Visual Studio 2015, change to 14.0 should be better. – Leo Liu Jan 19 '18 at 09:46
  • I use VS 2015. So am I write to 14.0 instead of 12.0 ? – TesterG Jan 19 '18 at 11:29
  • Yes, why do not you try it? According to your error log, this is the advice I can give now. – Leo Liu Jan 22 '18 at 01:40

2 Answers2

11

VS 2015 Toolset may be unknown or missing

According to the error message "Project file contains ToolsVersion="12.0". ", it shows that your project was upgraded from Visual Studio 2013. So when you publish it with Visual Studio 2015, you may get this error "This toolset may be unknown or missing..."

To resolve this issue, you can try to update your project file: Right your project->Unload project->Edit Yourprojectname.csproj->change the ToolsVersion="12.0" to ToolsVersion="14.0" in the second line.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

If you are using MSBuild command line build your project, you can can override the ToolsVersion Settings of Projects and Solutions by using command prompt:

msbuild.exe someproj.proj /tv:14.0
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • In my case I had 4.0 than I checked in build error it was expecting 15.0. Update from 4.0 to 15.0 resolved the problem. I faced this problem in project when I switched from SVN repository to Azure DevOps repos. wondering! – Sameer Dec 03 '19 at 08:05
  • How do I know which version is the right one? – Paul Apr 21 '22 at 17:29
0

Why don't you try changing the version of the "Microsoft.Net.Compilers" from from v2.6.1 to v2.4.0 as per explained here

Daniel Perez
  • 4,292
  • 4
  • 29
  • 54