The definition of CloneFileAsync is different for target frameworks:
|
#if NET6_0 || NETSTANDARD2_1 |
|
ValueTask |
|
#elif NETSTANDARD2_0 |
|
Task |
|
#else |
|
#error Target Framework not supported |
|
#endif |
|
CloneFileAsync(string source, string destination, CloneFlags cloneFlags, CancellationToken cancellationToken); |
The NuGet mechanism requires the API for higher framework being strict superset of lower framework. See more at https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/package-validation/compatible-framework-in-package-validator .
In short, the assembly used for run time will be picked by the framework of entry project, but for compile time it will be picked by current project. Such incompatibility will cause MissingMethodException when using in a transitive project targeting netstandard2.0.
The definition of
CloneFileAsyncis different for target frameworks:CopyOnWrite/lib/ICopyOnWriteFilesystem.cs
Lines 122 to 129 in 945d316
The NuGet mechanism requires the API for higher framework being strict superset of lower framework. See more at https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/package-validation/compatible-framework-in-package-validator .
In short, the assembly used for run time will be picked by the framework of entry project, but for compile time it will be picked by current project. Such incompatibility will cause
MissingMethodExceptionwhen using in a transitive project targeting netstandard2.0.