Forum Xamarin.Forms

System.ArgumentNullException: Value cannot be null. Parameter name: stream

XamarinsXamarins Member ✭✭

Hi All,

I am get this (System.ArgumentNullException: Value cannot be null.
Parameter name: stream) exception when reading file in Xamarin forms.

Please can you help on this.


Best Answer


  • GraverobberGraverobber Member ✭✭✭

    As your log says your stream object is null that means that the line loading the stream returns null which means that either the resourceID you pass is wrong or the resource is not in the same assembly as your MapPage where you're loading assembly from.
    Things to do/test:

    Double check that RevealDriverApp.MapStyle.json is the correct ID
    I also think you don't need the $ in front, just pass the string. Perhaps that's already the issue.
    Check if the assembly is the same. If not you can also just use Assembly.Load("YourAssemblyName") to get the correct one.

Sign In or Register to comment.