The reason for this problem may be that the UnitTests.dll in your project is built for Framework 2.2 and Platform AnyCPU, but in the UnitTest task, Framework 4.0 and Platform x64 is used. You can add a /Framework
parameter to solve this question.
/Framework:.NETCoreApp,Version=v2.0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…