Skip to content

[VS / MSBuild 17.13]: Files with build action None and CopyToOutputDirectory are no longer copied #11442

Description

@Mik4sa

Issue Description

I updated my local visual studio from 17.12.4 to 17.13.0. Since then my local build inside visual studio or directly using msbuild is broken. Files with build action None and CopyToOutputDirectory=Always are no longer copied to it's target path. They are simply missing. I was already able to see whats causing all this. It's a simple brace in my path. I made a sample app for this. Take a look at this:
https://github.com/Mik4sa/msbuild-brace-in-path-error

Steps to Reproduce

To reproduce open the Developer Command Prompt for VS 2022 for example and execute the following command inside the cloned repo:
MSBuild.exe ConsoleApp2.sln -t:Build -p:Configuration=Release -v:quiet -m /restore

Check this file for the diagnostic output of that command (in german): diag-log.txt

Expected Behavior

The files should be copied to the output directory.

Actual Behavior

No file is copied to the output directory.

Analysis

As noted above the brace ( in the path is causing this.

Versions & Configurations

  • MSBuild-Version 17.13.9+e0f243f1e für .NET Framework
    17.13.9.7704
  • Windows 11 24H2 (Build 26100.3037)
  • AMD64 (x64)

Metadata

Metadata

Labels

Priority:2Work that is important, but not critical for the releasetriaged

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions