Hi @Pham Minh Tu ,
Thank you for taking time to post this issue in Microsoft Q&A forum.
It seems that there are something wrong with the assemblies(Fakes), maybe the versions, or some related files that generated before, under .NET Framework, but are not supported in .NET Core 3.1.
I suggest you try to remove the Fakes
, the FakesAssemblies
, the bin
and obj
folders in your project folder, then try to re-add the projects reference in VS (right-click the Dependencies
> Add Project Reference… > Uncheck the project checkbox > OK > Do the same operations but this time check the project checkbox > OK).
After that re-add the Fakes Assembly(right-click the project under Dependencies , Projects > Add Fakes Assembly) and rebuild then rerun your project. Please remember to make a backup of your solution and then delete the folders.
In short, make a backup of your solution > delete Fakes
, FakesAssemblies
, bin
and obj
folders > re-add the project reference > re-add the Fakes Assembly > rebuild your unit test project > run the test.
Hope this helps.
Sincerely,
Tianyu
- If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.