I'm working on a Xamarin Forms app which has two projects, an Android App and an iOS app. All the other code is stored in shared projects.
Solution looks like this:
- MyApp.Android (Android project), references MyApp.Base
- MyApp.iOS (iOS project), references MyApp.Base
- MyApp.Base (Shared project)
I am using the following code to read an SVG image from the shared project:
using (var stream = GetType().Assembly.GetManifestResourceStream("MyApp.Base.image.svg"))
{
// do work here...
}
This works perfectly when the image is in the Android or iOS project, but I want the image to be shared so I put it in the shared project.
GetType().Assembly return MyApp.Android, thus it cannot find the image. I suppose I'm overlooking something but I haven't been able to find a solution.
Can anyone point me in the right direction? Thanks!