Updating Xamarin Forms causes System.IO.FileNotFoundException - ReactiveUI.Winforms when using ReactiveUI

Viewed 524

After updating the Xamarin Forms package in my project to 3.4.0.1009999 I have started getting a System.IO.FileNotFoundException when using WhenAnyValue from the ReactiveUI package. The API instructions only say to include ReactiveUI, ReactiveUI.XamForms and ReactiveUI.Events.XamForms which I have.

Despite this I get Could not load file or assembly 'ReactiveUI.Winforms' or one of its dependencies here:

this.WhenAnyValue(x => x.DiscountSliderValue).Throttle(TimeSpan.FromMilliseconds(800)).Subscribe(CartManager.Instance.UpdateDiscountPercent);

Adding in the ReactiveUI.Winforms package sadly does not help.

This is code and packaging that has been working in this project for 6 months or more with no issues so it is a new problem. I have spent a significant amount of time looking for answers and have found nothing.

Any ideas on the cause?

1 Answers

I have run into the same issue but the other way round. Winforms is asking for the XamForms dll, when nothing should be referencing XamForms

Checking the fusion log shows that in my case the calling assembly is ReactiveUI, see trimmed version below:

=== Pre-bind state information ===
LOG: DisplayName = ReactiveUI.XamForms, Version=9.11.0.0, Culture=neutral, PublicKeyToken=null Calling assembly : ReactiveUI, Version=9.11.0.0, Culture=neutral, PublicKeyToken=null.

Which doesnt make any sense to me!

The solution that I found was to close Visual Studio and delete the whole .vs folder. Sometimes the information in that folder becomes corrupt. I cant say for sure why or even if this was the real cause because it doesnt seem like it should be, but it seemed to work for me.

Related