dotnet / dotnet/project-system
Fast Up-To-Date Check: Build-time generated <Content/> files not copied
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
## Visual Studio Version
Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.10.4
## Summary
I have a dependency (Class library) which generates some content files in the build-time. And this files are not copied into the app output directory when FUTDC are used.
## Steps to Reproduce
1. Download solution: [Test.zip](https://github.com/user-attachments/files/16284490/Test.zip)
2. Make full rebuild
3. Check the `App\bin\Debug\net8.0\ContentDir` folder and make sure that both static and dyncmic content files are here: `StaticContent.xml & DynamicContent.txt`
4. Remove the `App\bin\Debug\net8.0\ContentDir` folder.
5. Hit F5 in VS to make a build with a FUTDC
6. Check the `App\bin\Debug\net8.0\ContentDir` folder content
## Expected Behavior
both static and dyncmic content files were copied during the build: `StaticContent.xml & DynamicContent.txt`
## Actual Behavior
Only static content was copied, the folder contains only the `StaticContent.xml` file. `DynamicContent.txt` is missing.
## User Impact
FUTDC gives the unpredictable build resultd depending on the state of the output folder, so I was forced to disable FUTDC globally.
## Additional details
* The build-time Content files generation was made based on the following manual: https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-builds-for-generated-files?view=vs-2022
* The custom target is in the `ClassLib\ClassLib.csproj` file
* I have also tried to hook up dependencies for the additional targets without success.
```
$(AssignTargetPathsDependsOn);MyTarget;
$(GetCopyToOutputDirectoryItemsDependsOn);MyTarget;
```
* I suspect then this issue may be caused by the same thing as https://github.com/dotnet/project-system/issues/9350, but can't say for sure.
Contributor guide
Assessment
This issue has not been assessed yet.