Bug 58569 - Unit tests fail after upgrade to XF 2.3.5
Summary: Unit tests fail after upgrade to XF 2.3.5
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-03 12:34 UTC by Michel Moorlag
Modified: 2017-08-03 15:14 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Michel Moorlag 2017-08-03 12:34:18 UTC
I have a Xamarin Forms solution with a unit tests project using Moq (https://www.nuget.org/packages/Moq/) version 4.7.99. All unit tests run fine.

After upgrading Xamarin Forms to version I have rebuild my solution. Now when I try to run the unit tests in the ClassInitialize method on line "Xamarin.Forms.Mocks.MockForms.Init();" I get the exception:
Could not load type 'Xamarin.Forms.IPlatformServices' from assembly 'Xamarin.Forms.Core, Version=, Culture=neutral, PublicKeyToken=null'.

I am not sure if this is a Moq or XF problem.
Comment 1 Michel Moorlag 2017-08-03 12:59:44 UTC
Found it, version 2.3.5 is not support (yet?) by Xamarin.Forms.Mocks.
From the documentation in https://github.com/jonathanpeppers/Xamarin.Forms.Mocks/

Xamarin.Forms	Xamarin.Forms.Mocks
2.3.4.x	2.3.4.x
Older	Unsupported

This issue can be closed
Comment 2 Michel Moorlag 2017-08-03 13:09:56 UTC
Added an issue there, see: