Description
When building a test project that references TUnit.Mocks.Http, compilation fails with:
CSC: Error CS1705: Assembly "TUnit.Mocks.Http, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" uses "TUnit.Mocks, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" which has a higher version than referenced assembly "TUnit.Mocks" with identity "TUnit.Mocks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c".
Similarly with TUnit.Mocks.Logging:
CSC: Error CS1705: Assembly "TUnit.Mocks.Logging, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" uses "TUnit.Mocks, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" which has a higher version than referenced assembly "TUnit.Mocks" with identity "TUnit.Mocks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c".
Expected Behavior
The project should compile successfully when TUnit.Mocks.Http is referenced together with the rest of the TUnit packages.
Actual Behavior
Compilation fails with CS1705, indicating that TUnit.Mocks.Http depends on a newer TUnit.Mocks assembly version than the one resolved by the consuming project.
Steps to Reproduce
- Create or open a test project targeting modern .NET.
- Reference the following packages:
TUnit
TUnit.AspNetCore
TUnit.Mocks.Http
TUnit.Mocks.Logging
TUnit.Mocks.Assertions
- Build the project.
- The build fails with
CS1705.
TUnit Version
1.36.0
.NET Version
net8.0 / net9.0 / net10.0
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
CSC: Error CS1705: Assembly "TUnit.Mocks.Http, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" uses "TUnit.Mocks, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" which has a higher version than referenced assembly "TUnit.Mocks" with identity "TUnit.Mocks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c".
CSC: Error CS1705: Assembly "TUnit.Mocks.Logging, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" uses "TUnit.Mocks, Version=1.36.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c" which has a higher version than referenced assembly "TUnit.Mocks" with identity "TUnit.Mocks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b8d4030011dbd70c".
Additional Context
Environment
- .NET SDK:
net8.0 / net9.0 / net10.0
- Related packages:
TUnit
TUnit.AspNetCore
TUnit.Mocks
TUnit.Mocks.Http
TUnit.Mocks.Logging
TUnit.Mocks.Assertions
Notes
This appears to be a package versioning / dependency alignment issue. The consuming project resolves TUnit.Mocks to 1.0.0.0, while TUnit.Mocks.Http expects TUnit.Mocks 1.36.0.0.
It would be helpful if the package graph or published package metadata ensured consistent assembly versions across:
TUnit
TUnit.AspNetCore
TUnit.Mocks
TUnit.Mocks.Http
TUnit.Mocks.Logging
TUnit.Mocks.Assertions
Possible workaround
Align all TUnit-related packages to the same version and explicitly reference TUnit.Mocks in the test project.
IDE-Specific Issue?
Description
When building a test project that references
TUnit.Mocks.Http, compilation fails with:Similarly with
TUnit.Mocks.Logging:Expected Behavior
The project should compile successfully when
TUnit.Mocks.Httpis referenced together with the rest of the TUnit packages.Actual Behavior
Compilation fails with
CS1705, indicating thatTUnit.Mocks.Httpdepends on a newerTUnit.Mocksassembly version than the one resolved by the consuming project.Steps to Reproduce
TUnitTUnit.AspNetCoreTUnit.Mocks.HttpTUnit.Mocks.LoggingTUnit.Mocks.AssertionsCS1705.TUnit Version
1.36.0
.NET Version
net8.0 / net9.0 / net10.0Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
Environment
net8.0 / net9.0 / net10.0TUnitTUnit.AspNetCoreTUnit.MocksTUnit.Mocks.HttpTUnit.Mocks.LoggingTUnit.Mocks.AssertionsNotes
This appears to be a package versioning / dependency alignment issue. The consuming project resolves
TUnit.Mocksto1.0.0.0, whileTUnit.Mocks.HttpexpectsTUnit.Mocks1.36.0.0.It would be helpful if the package graph or published package metadata ensured consistent assembly versions across:
TUnitTUnit.AspNetCoreTUnit.MocksTUnit.Mocks.HttpTUnit.Mocks.LoggingTUnit.Mocks.AssertionsPossible workaround
Align all TUnit-related packages to the same version and explicitly reference
TUnit.Mocksin the test project.IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE