System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

shivash pal 1 Reputation point
2021-10-07T07:37:32.43+00:00

Message:
Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Stack Trace:
Mathe.get_AddNum()
UnitTest1.TestMethod1() line 27

This occurs when i was trying to do unit test on small addition app. Please give any suggestion
I will be great of you

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
329 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kyle Wang 5,531 Reputation points
    2021-10-08T02:52:05.65+00:00

    Hi shivashpal-5723,

    Welcome to our Microsoft Q&A platform!

    "Xamarin.Forms.Core" is contained in "Xamarin.Forms", so try to uninstall the "Xamarin.Forms" Nuget Package and install the latest version.

    Then delete the "bin" and "obj" folder under project path, and clean&rebuild the project.

    Regards,
    Kyle


    If the response 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.

    1 person found this answer helpful.
    0 comments No comments