I'm working with a Nuget package that, when installed, adds some binary files to the shared project with the build action "Content." In a Windows application, one could access these files' contents from within the application using Application.GetContentStream(Uri). (I'd link to the Microsoft documentation here, but I can't yet post links on the forums.) This functionality, however, isn't part of the .NET standard and isn't accessible on mobile platforms.
While digging through some of the generated build files, however, I noticed that under
MyProject/MyProject.Android/obj/Debug/90/assets, these content files had been copied. This surprised me, as I had never manually copied the files into
MyProject.Android/Assets. Furthermore, in
MyProject/MyProject.Android/obj/project.assets.json, the files were listed under their respective nuget package.
Having observed this behavior, I have two questions:
1. What happens to files with a Build Action of "Content?" (Particularly on iOS, since I was only able to find these files on Android.) Are there any documentation articles that describe what's happening here?
2. Is there any cross-platform way to access files with a Build Action of "Content?"
2a (bonus question). If not, what's the most elegant way to access static resources (like binary files) across platforms? (I've used platform-specific implementations like AndroidAssets in the past, but a cross-platform solution would be ideal.)