Fast up-to-date check with SDK project doesn't see new embedded resources
See original GitHub issueVisual Studio Version: 16.3.7
Summary:
I have set up a SDK-style .csproj
to default all .sql
files to be embedded resources. If I add a new .sql
file via the file system (touch on the command line, context menu -> new file in Windows Explorer) or via File->New in Visual Studio, the new file will not be embedded as VS thinks the project is up to date.
Steps to Reproduce:
I have a repository with a minimal reproduction and more detail https://github.com/hyrmn/ReproGlobsNotEmbedding
-
Create a C# console project with the SDK-style project file (.NET Full Framework or Core)
-
Add two file globs for SQL files
<ItemGroup>
<None Remove="**\*.sql" />
<EmbeddedResource Include="**\*.sql" />
</ItemGroup>
-
Build the project a few times. You should see “1 up-to-date” in the build output window
-
Add a .sql file. It can be empty.
-
Compile the project again
-
Use ILSpy to check the file manifest for the file from step 4
Expected Behavior:
The file should be listed under Resources when viewed in ILSpy, DotPeek or another tool.
Actual Behavior:
The file is not listed.
Oddly, the file is correctly picked up if it’s added as part of a git pull
from a remote repository.
User Impact:
Application runs do not included embedded resource changes. Also, my outlook is 3% gloomier than it otherwise would be. I would be 8% happier if this worked correctly (the delta is because I’d know that reporting this issue and repro steps helped in getting it fixed and that would make me feel nice)
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Thanks for the great error report and the chuckle 👍
Thanks @rainersigwald.