Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild. I keep getting this warning but I don't know why

Tags:

msbuild

I keep getting this warning but I don't know why.

The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild which can lead to unexpected build results. Tools such as NuGet will write outputs to the path specified by the "MSBuildProjectExtensionsPath" instead. To set this property, you must do so before Microsoft.Common.props is imported, for example by using Directory.Build.props. For more information, please visit https://go.microsoft.com/fwlink/?linkid=869650

It's code is MSB3539.

I have read that article in link, and I have created Directory.Build.props file in my solution directory, in which I have specified property

<MSBuildProjectExtensionsPath>$(SolutionDir)artifacts\$(MSBuildProjectName)\$(Configuration)</MSBuildProjectExtensionsPath>

But I still getting this warning. What am I doing wrong? Solution builds, every file is placed correctly. But it's kind of annoying.

Project is .NET 7.0 class library..

like image 362
Petr Havlát Avatar asked Oct 20 '25 14:10

Petr Havlát


1 Answers

The warning is because BaseIntermediateOutputPath is changed within the body of the project file.

Move the modification of BaseIntermediateOutputPath from the project file to the Directory.Build.props file. Directory.Build.props is imported before Microsoft.Common.props.

Don't change MSBuildProjectExtensionsPath.

like image 51
Jonathan Dodds Avatar answered Oct 22 '25 05:10

Jonathan Dodds