TestableIO/System.IO.Abstractions

Path.Join missing (string path1, string path2) for .net3.1 same as #774

foz1284 opened this issue · 2 comments

Hi, love the project, it just gave me a headache this afternoon!

issue #774 still applies for .net Core 3.1

This is no longer a significant issue for me as I have just updated to .net5.0 to workaround the problem but it might occur for others so I thought I should raise an issue:

The fix appears to only apply to FEATURE_PATH_JOIN_WITH_PARAMS which supports the following targets:

Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net5.0'"

I'm having this issue with .net Core 3.1 but you can see from the link below that it should support Join(string path1, string path2)
https://docs.microsoft.com/en-us/dotnet/api/system.io.path.join?view=netcore-3.1#system-io-path-join(system-string-system-string)

I've raised this as a new issue as I wasn't sure if my comment on the closed issue would get seen, sorry for the duplicate.

Thanks for raising the issue @foz1284 and sorry for the headache 😀

#774 was a different problem where missing methods and smart overload resolution made the library act a bit weird.

The reason why the methods are missing in your case is the following: This library does not provide an explicit target for .NET Core 3.1. When a .NET Core 3.1 project references a library NuGet will pick then "next-best" target, which in our case is .NET Standard 2.0. This framework in turn does not expose the Path.Join overloads, causing the errors you are seeing.

So, even if I understand your confusion, this is actually working as expected. I'll therefore close the issue. Feel free to @ me if you have further questions!

@fgreinacher thanks for the explanation!