Edit

Share via


MSB3501 diagnostic code

This article describes the MSB3501 error code.

Message text

MSB3501: Could not read lines from file 'value'.

Description

This error occurs when your project is using the ReadLinesFromFile task, but the specified file wasn't found.

Resolution

Check the input to the ReadLinesFromFile task. You can use the -v:diag switch on the MSBuild command line to get more detailed information about the MSBuild execution, such as the values of the input parameters provided to the ReadLinesFromFile task. In Visual Studio, in Tools, Options, Build and Run, set Verbosity to Diagnostic.

If the input comes from a property value, check that the property has a value. If it comes from a property set at the command line, check that the syntax of the command line and the value of the environment variable are correct; especially check shell escape characters and ensure proper use of quotes, especially the need for quotes when providing filenames with spaces in the path. If the input file comes from an environment variable, check the spelling of the environment value and verify that it has the expected value.

Applies to

All versions of MSBuild