Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mik4sa opened this issue Feb 14, 2025 · 9 comments
Assignees
Labels
Priority:2 Work that is important, but not critical for the release triaged

Comments

@Mik4sa
Copy link

Mik4sa commented Feb 14, 2025

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)
@JanKrivanek
Copy link
Member

Possibly related? #11052

@Mik4sa
Copy link
Author

Mik4sa commented Feb 18, 2025

Possibly related? #11052

Whatever value I try for CopyToOutputDirectory (including IfDifferent) the file is never copied to the output directory. So I don't think that this is related. Thank you :)

@qudooschaudhry
Copy link

Yes, this is completely broken. I also updated and ran into the same issue. None of the appsettings files or other static files are copied to output. I had to change from "none" to "content" for it to work.

@maridematte maridematte added Priority:2 Work that is important, but not critical for the release triaged labels Feb 18, 2025
@JanKrivanek
Copy link
Member

Would anyone here be able to provide binlogs of their case?

Details on sharing binary logs More information on binary logs
NOTE: Binary logs capture environment information. Ensure it does not include any information you don't want to be public before you attach one. If you want to share one just with Microsoft, you can report a problem through Visual Studio  and share it privately with Microsoft.

@Mik4sa
Copy link
Author

Mik4sa commented Feb 19, 2025

I've attached an example / a repo above. Isn't that enough already?
Also you just need a single bracket (like () anywhere in your path. So the repo itself isn't that important.

@qudooschaudhry
Copy link

qudooschaudhry commented Feb 19, 2025

@JanKrivanek I've provided the msbuild binlogs through report a problem, but it hardly looks to be privately with MS. Was I supposed to select something I missed?

Also, I do not have a parentheses in my path as reported in the original issue but I am still impacted. I do have an @ sign, not sure if that matters or not.

@rparnas
Copy link

rparnas commented Feb 21, 2025

I can confirm my CopyToOutput: Copy if newer was failing with an "@" in my directory name. Removed the "@" and works fine.

(To clarify, failing as in the file was silently not copying to output with no error message)

@YuliiaKovalova YuliiaKovalova self-assigned this Feb 21, 2025
@YuliiaKovalova
Copy link
Member

YuliiaKovalova commented Feb 21, 2025

Hi @Mik4sa ,

I have checked your repo on the changes from #11237 and it works now.
It will be available in net9 (9.0.3xx version).

p.s. Thank you for providing the repro repo , it always simplifies the work on our side!

@Mik4sa
Copy link
Author

Mik4sa commented Feb 21, 2025

@YuliiaKovalova Nice :) Thanks for letting me know. I'm going to try it once it's available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

6 participants