Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild

How do I get rid of this error, I am using Visual Studio 2008 because 2010 wouldn't open some of my VB Projects.

like image 239
Slee Avatar asked Dec 07 '09 16:12

Slee


People also ask

How do I check MSBuild ToolsVersion?

Starting in Visual Studio 2013, the MSBuild Toolset version is the same as the Visual Studio version number. MSBuild defaults to this Toolset within Visual Studio and on the command line, regardless of the Toolset version specified in the project file. This behavior can be overridden by using the -ToolsVersion flag.

How do I install MSBuild?

To install MSBuild on a system that doesn't have Visual Studio, go to Build Tools for Visual Studio 2019, or install the . NET SDK. If you have Visual Studio, then you already have MSBuild installed. With Visual Studio 2022, it's installed under the Visual Studio installation folder.

How do I know what version of Visual Studio tools I have?

3) Right-click on your project-->Properties-->Configuration Properties-->General-->change Platform Toolset to Visual Studio 2019 v142 . First of all, ToolVersion is related to the version of MSBuild that is included in the Visual Studio edition like.

How do I use MSBuild EXE?

Use MSBuild at a command prompt To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.


1 Answers

A VS2008 project file starts out with

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

where the ToolsVersion indicates the .net framework tools version. VS2010 uses .net 4, so clearly has made the corresponding change in its tools version.

I would expect that opening your project files in Notepad and resetting the tools version to 3.5 will clear that issue. Whether there are other backwards incompatibilities lurking, I couldn't say.

like image 127
Steve Gilham Avatar answered Oct 17 '22 10:10

Steve Gilham