I'm trying to write to a file.
Sorry for the mistake. But embedded resources are read only, we cannot edit the embedded file. To read and write to a file in Xamarin.Forms, try to achieve this on each native platform project.
Similar issue: https://stackoverflow.com/questions/29395367/xamarin-streamwriter/29395483#29395483
Related tutorials:
https://learn.microsoft.com/en-us/xamarin/android/platform/files/
https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/file-system