The error “error MSB4036: The “XmlPeek” task was not found” is an error that is invoked whenever you are coding in delphi and trying to update your version of delphi. Given below is the snippet of the error:
error MSB4036: The "XmlPeek" task was not found
I would like to share with you the steps I took to fix the “error MSB4036: The “XmlPeek” task was not found” in your project file.
Why “error MSB4036 The “XmlPeek” task was not found” error is seen?
The error, “error MSB4036: The “XmlPeek” task was not found” is seen because of known bugs which are found in Delphi 11.1 version that has at least 3 recently reported bug: RSP-37855, RSP-38466, and RSP-38467.
You can find the details about Delphi 11.1 version reported bug on embarcadero official site using link https://quality.embarcadero.com/secure/Dashboard.jspa.

Delphi 11 Adds Official Support for Windows 11, macOS 12 Monterey, iOS 15 and Android 12, and Improves on the Milestone Capabilities of 11 Alexandria, Providing an Improved IDE and User Experience, Improved Code Insight, More Powerful Compilers and Debuggers, and Richer RTL, UI, and Database Libraries.
The detailed solution to fix the error “error MSB4036: The “XmlPeek” task was not found”, is given below:
How to fix “error MSB4036 The “XmlPeek” task was not found”?
To fix the error, you will have to add /tv:4.0
in your MSBuild command line or modify the first line in the .dproj
file.
To fix the error, “error MSB4036: The “XmlPeek” task was not found”, follow the below mentioned steps:
Method 1: Adding /tv:4.0
This is a known bug which is found in Delphi 11.1 that has at least 3 bug reports: RSP-37855, RSP-38466, and RSP-38467.
You will have to add a toolsversion
parameter to the msbuild
command as below mentioned:
msbuild someproject.dproj /v:q /p:Platform=An
You will also have to add /tv:4.0
to your MSBuild command line, or modify the first line in the .dproj
file to:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
This should fix the error, “error MSB4036: The “XmlPeek” task was not found”.
Method 2: Run rsvars.bat
To fix the error, “error MSB4036: The “XmlPeek” task was not found”, follow the below mentioned steps:
First you will have to run rsvars.bat
by following the command mentioned below:
FOR %%v IN ("%frameworkdir%") DO SET "toolsversion=%%~nv"
ECHO msbuild ...blah... /toolsversion:%toolsversion:~1%
The variable frameworkdir
would have been set to rsvars.bat
. The for
command in the code parses its value. For example C:\Windows\Microsoft.NET\Framework\v4.0.30319
as though it is a filename, and picks v4.0
as the “filename”
Then you will have to use the value assigned to toolsversion
, starting at character number one.
This should fix the error, “error MSB4036: The “XmlPeek” task was not found”.
Conclusion
To fix the error “error MSB4036 The “XmlPeek” task was not found”, either you have to add /tv:4.0
in your MSBuild command line, or modify the first line in the .dproj
file. You may also fix your error by running rsvars.bat.