CaseyHofland
CaseyHofland

Reputation: 538

Stop xunit from generating global usings

I'm testing with xunit on multiple frameworks (.Net 8 & .Net Core 3.1). The problem is that it keeps auto-generating this GlobalUsings file in my obj folder:

// <auto-generated/>
global using global::Xunit;

I cannot have global usings since .Net Core 3.1 is running on C# 8.0. I have already disabled them in my project using <ImplicitUsings>disable</ImplicitUsings>, but how can I disable a global using generated from a package?

I have tried Googling the issue both on xunit and global usings from microsoft but I haven't found any solid documentation targeting this specific issue.

Upvotes: 0

Views: 207

Answers (1)

CaseyHofland
CaseyHofland

Reputation: 538

For anyone who runs into the same issue: the visual studio template was installing xunit 2.5.3 by default, but I needed 2.4.0. That pretty much solved it.

Upvotes: 0

Related Questions