✅ Multi-target, wrong version
I am multi-targeting a project for NetFx and Net6/7. Specifically, there are four projects in play here:
Remora.Results - Provides the base Result and ResultError types for Net6/7
Tafs.Activities.Results - Provides the base Result and ResultError types for NetFx
Tafs.Activities.Results.Extensions - Conditionally includes Remora.Results or Tafs.Activities.Results based on framework version.
Tafs.Activities.Serialization - Targets Remora.Results or Tafs.Activities.Results based on target version. Additionally targets Tafs.Activities.Results.Extensions for extra error types.
My SocialSecurityNumber class relies on Tafs.Activities.Results.Extensions.Errors.ValidationError. This is happy on NetFx, but on Net6/7, I get an error saying I cannot implicitly convert it to Remora.Results.Result. I would expect this error if it picked the wrong version of the error to provide.
The source code of the ValidationError is this:
Whether it implements Tafs.Activities.Results.ResultError or Remora.Results.ResultError should in theory depend on the dotnet version, but it does not appear to be behaving as such.
To make things even stranger, this framework comparison extends to the csproj too. So in theory, the Net6/7 version shouldn't even be aware of Tafs.Activities.Results.
Any thoughts as to what might be going on here?
Remora.Results - Provides the base Result and ResultError types for Net6/7
Tafs.Activities.Results - Provides the base Result and ResultError types for NetFx
Tafs.Activities.Results.Extensions - Conditionally includes Remora.Results or Tafs.Activities.Results based on framework version.
Tafs.Activities.Serialization - Targets Remora.Results or Tafs.Activities.Results based on target version. Additionally targets Tafs.Activities.Results.Extensions for extra error types.
My SocialSecurityNumber class relies on Tafs.Activities.Results.Extensions.Errors.ValidationError. This is happy on NetFx, but on Net6/7, I get an error saying I cannot implicitly convert it to Remora.Results.Result. I would expect this error if it picked the wrong version of the error to provide.
The source code of the ValidationError is this:
Whether it implements Tafs.Activities.Results.ResultError or Remora.Results.ResultError should in theory depend on the dotnet version, but it does not appear to be behaving as such.
To make things even stranger, this framework comparison extends to the csproj too. So in theory, the Net6/7 version shouldn't even be aware of Tafs.Activities.Results.
Any thoughts as to what might be going on here?