Skip to content

Fast up-to-date check with SDK project doesn't see new embedded resources #5794

@hyrmn

Description

@hyrmn

Visual 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

  1. Create a C# console project with the SDK-style project file (.NET Full Framework or Core)

  2. Add two file globs for SQL files

    <ItemGroup>
        <None Remove="**\*.sql" />
        <EmbeddedResource Include="**\*.sql" />
    </ItemGroup>
  1. Build the project a few times. You should see "1 up-to-date" in the build output window

  2. Add a .sql file. It can be empty.

  3. Compile the project again

  4. 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)

Metadata

Metadata

Assignees

Labels

Feature-Up-to-dateBuild up-to-date check that avoids shelling out to MSBuild unless necessary.good-first-issue[up-for-grabs] Good for learning and for external contributors. Relatively self-contained.

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions