system.invalidoperationexception sequence contains no elements at system.linq.enumerable.first[TSource]{IEnumaberable`1 source}

Viewed 1088

I installed an updated visual studio in 2019. After that, I opened my xamarin application and ran the app. It's built successfully. Before opening the application in the emulator I got the below issue.

enter image description here

1 Answers

I was helped by the exclusion of using an inherited classes without overridden methods.

for example base class defined in net standard lib:

public class DFStorage
{
    public virtual bool SaveAppTextFile(...)
    {
        ...
    }
    public virtual string GetAppTextFile(...)
    {
        ...
    }
}

inherited in platform specific lib: (without any overrides)

public class DFStorageIOS : DFStorage
{

}

App use platform class.

Overriding of one method was enough:

public class DFStorageIOS : DFStorage
{
    public override bool SaveAppTextFile(...)
    {
        return base.SaveAppTextFile(...);
    }
}
Related