Ambiguity with Action and Func parameter

前端 未结 3 1324
旧时难觅i
旧时难觅i 2021-02-12 19:10

How is it possible that this code

TaskManager.RunSynchronously(fileMananager.BackupItems, package);

causes a compile error

3条回答
  •  梦谈多话
    2021-02-12 19:58

    Another possible explanation for this nowadays is this:

    The code was written for C# version 7.3 (used by default by MSBuild 16.x, corresponding to VS2019), but the build is attempted with an earlier version of C# (which is the default for MSBuild 15.x, corresponding to VS2017).

    Earlier versions of C# throw this error, but the overload is resolved correctly in C# 7.3.

提交回复
热议问题