-
-
Notifications
You must be signed in to change notification settings - Fork 121
[Bug]: TUnitImplicitUsings / TUnitAssertionsImplicitUsings not respected in Directory.Build.props #5208
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
All test projects are configured using a single property set at the folder level in Directory.Build.props
If I want to prepare migrating it to TUnit, I want both TUnit and NUnit to be present in the projects to run code fixers.
However, the migration workaround to remove explicit usings:
<PropertyGroup>
<TUnitImplicitUsings>false</TUnitImplicitUsings>
<TUnitAssertionsImplicitUsings>false</TUnitAssertionsImplicitUsings>
</PropertyGroup>doesn't work if I try to apply it in Directory.Build.props.
Expected Behavior
Projects build successfully, there are no namespace conflicts.
Actual Behavior
error CS0104: 'Test' is an ambiguous reference between 'TUnit.Core.TestAttribute' and 'NUnit.Framework.TestAttribute'
Steps to Reproduce
- Create NUnit test project
- Add TUnit to Directory.Build.props
- Add disabling implicit usings to Directory.Build.props
- Build
TUnit Version
1.20.0
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
error CS0104: 'Test' is an ambiguous reference between 'TUnit.Core.TestAttribute' and 'NUnit.Framework.TestAttribute'Additional Context
Putting those properties directly into csproj files works.
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working