2

I am building an app with Xamarin and Breez# use VS2017 for Mac, all goes fine till VS2017 notified me there are updates yesterday, then I updated it, also the package of Xamarin.forms from nugget.

then my app cannot work. and throw an exception when trying to call a method to get data.

{System.TypeLoadException: Could not find method due to a type load error 
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder
`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in 
/Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11
/src/mono/mcs/class/referencesource/mscorlib/system/runtime
/compilerservices/AsyncMethodBuilder.cs:471 

the method:

 public async Task<IEnumerable<Tenant>> GetAllItems()
    {
        try
        {
            // ignore the flurry of events when query results arrive
            _ignoreEntityChanged = true;
            var query = new EntityQuery<Tenant>().From(_resourceName);

            var qr = await _em.ExecuteQuery(query);
            _ignoreEntityChanged = false;
            var result = qr.ToList();

            return result;

        }
        catch (Exception e)
        {
            _ignoreEntityChanged = false;
            return new List<Tenant>(); // return empty result instead
        }
    }

every time when I try to step into this method, the error come out. and then I tried comment all the lines but only return an empty list, I can step into the method and it works. the next step, I uncomment the line:

var query = new EntityQuery<Tenant>().From(_resourceName);

then I cannot step into the method, and the error throws.

I suppose the EntityQuery has something wrong with the newest vs2017 and Xamarin.Form, but no sure of that.

even
  • 315
  • 4
  • 11
  • Which version of Breez# do you install ? When I try to install Breez#0.6.0.9 , it throws a error `Could not install package 'Microsoft.AspNet.WebApi.Client 5.2.3'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework` – ColeX Oct 12 '17 at 08:04
  • same as yours, the 'Microsoft.AspNet.WebApi.Client' is 5.2.3 – even Oct 13 '17 at 07:03
  • NuGet told me it is not compatible with `Xamarin.iOS,Version=v1.0`. How do you install it ? – ColeX Oct 13 '17 at 07:07
  • I used vs2017 in windows created an cross platform project(portable class library), then right click reference and use "Manage nuget package" to install breeze.Sharp. or use vs2017 for Mac open the project and add nuget package, both methods work. – even Oct 13 '17 at 08:10

0 Answers0