question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSB3539 (BaseIntermediateOutputPath modified after use) is triggered incorrectly

See original GitHub issue

From Microsoft.Common.CurrentVersion.targets:

    <Warning Condition=" '$(EnableBaseIntermediateOutputPathMismatchWarning)' == 'true' And '$(_InitialBaseIntermediateOutputPath)' != '$(BaseIntermediateOutputPath)' And '$(BaseIntermediateOutputPath)' != '$(MSBuildProjectExtensionsPath)' "
             Code="MSB3539"
             Text="The value of the property &quot;BaseIntermediateOutputPath&quot; 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 &quot;MSBuildProjectExtensionsPath&quot; 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"
             />

If MSBuildProjectExtensionsPath is overridden but BaseIntermediateOutputPath is not, the _InitialBaseIntermediateOutputPath will be a relative path (obj\) while BaseIntermediateOutputPath will be an absolute path. So the warning will be triggered when it shouldn’t.

@jeffkl

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
wouterrooscommented, Jan 27, 2020

Also seeing this issue in our project where we set MSBuildProjectExtensionsPath in Directory.Build.props as shown below. The warning only triggers on projects that import the Microsoft.NET.Sdk.Web Sdk.

<PropertyGroup>
  <MSBuildProjectExtensionsPath>obj\$(CopperPlatform)\</MSBuildProjectExtensionsPath>
</PropertyGroup>  
2reactions
jtbrowercommented, Jan 14, 2020

Out of the 130 NetStandard/NetCore projects that I have, I am only hitting this error on projects that import “Microsoft.NET.Sdk.Web” even though they all set the InterMediateOutputPath the same as the code block below. Reading this PR I think that this is a false warning in my circumstance too, am I truly safe to ignore it until it is resolved in Preview3 or will it cause non-deterministic build behavior?

This section is in my Directory.Build.Props. The purpose of this section is to assure that all build artifacts are placed at the root where our solution is located in each of our repos. Do I also need to set BaseIntermediateOutputPath?

<PropertyGroup>
  <IntermediateOutputPath>$(SolutionDir)artifacts\obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
  <OutputPath>$(SolutionDir)artifacts\bin\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
  <OutDir>$(OutputPath)</OutDir>
  <MSBuildProjectExtensionsPath>$(SolutionDir)artifacts\ext\$(Configuration)\$(MSBuildProjectName)\</MSBuildProjectExtensionsPath>
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
Read more comments on GitHub >

github_iconTop Results From Across the Web

MSB3539 (BaseIntermediateOutputPath modified after use ...
MSB3539 (BaseIntermediateOutputPath modified after use) is triggered incorrectly #3244. Open. dsplaisted opened this issue on Apr 27, ...
Read more >
The value of the property "BaseIntermediateOutputPath ...
I keep getting this warning but I don't know why. The value of the property "BaseIntermediateOutputPath" was modified after it was used by ......
Read more >
Error DependsOnTargets. _collectBundleResourses
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item. Then copy/paste the version information (you can use the " ......
Read more >
Out-of-band DotNet core
targets(813,5): warning MSB3539: The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild which can lead ...
Read more >
Microsoft.Common.CurrentVersion.targets
Code="MSB3539". Text="The value of the property "BaseIntermediateOutputPath" was modified after it was used by MSBuild which can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found