As found by @gkinsman, when using things like .ShouldMatchApproved() results in an exception being thrown when targetting net5:
System.TypeInitializationException : The type initializer for 'EmptyFiles.AllFiles' threw an exception.
Repo: https://github.com/gkinsman/ShouldlyRepro
This is because the EmptyFiles package is expected to copy an EmptyFile directory to the bin folder on build, and does this via targets files in the nuget package.
Something has changed in .NET 5 around the behavior of transitive dependencies here, if we explicitly reference EmptyFile as a top-level dependency then it works. That would be a quick workaround for Shouldly users.
I'm just creating a PR in EmptyFiles which I think will handle .NET5 appropriately.
As found by @gkinsman, when using things like
.ShouldMatchApproved()results in an exception being thrown when targettingnet5:Repo: https://github.com/gkinsman/ShouldlyRepro
This is because the
EmptyFilespackage is expected to copy anEmptyFiledirectory to the bin folder on build, and does this via targets files in the nuget package.Something has changed in .NET 5 around the behavior of transitive dependencies here, if we explicitly reference
EmptyFileas a top-level dependency then it works. That would be a quick workaround for Shouldly users.I'm just creating a PR in
EmptyFileswhich I think will handle .NET5 appropriately.