Skip to content

EmptyFiles directory is missing from dotnet publish output after 31.7.2 #1657

@tbaliukynas

Description

@tbaliukynas

Describe the bug

After upgrading Verify.NUnit from version 31.7.1 to 31.7.2 (or higher), tests started failing with the following error:

System.Exception : Failed to compare files
  ----> System.TypeInitializationException : The type initializer for 'EmptyFiles.AllFiles' threw an exception.
  ----> System.Exception : Could not find empty files directory. Searched: ...

My CI/CD workflow builds the test project once and then runs the compiled binaries on a schedule, so building and running tests are separate jobs. The test project is built using the dotnet publish command.

After inspecting the published output, I noticed that the EmptyFiles directory is missing. Downgrading to 31.7.1 resolves the issue.

Minimal Repro

Run the following:

git clone https://github.com/VerifyTests/Verify.git
cd ./Verify/usages/NUnitNugetUsage/
dotnet publish ./NUnitNugetUsage.csproj -o ./out/
ls -dir ./out/EmptyFiles/

Notice that the EmptyFiles directory is missing when using 31.7.2 or newer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions