I'm trying to create a very basic Xamarin app using Xamarin.Forms. Currently I have a PCL that only contains one small class and a file called TestPage.xml (on the root of the project). This XML file is set to EmbeddedResource, do not copy.
I'm trying to load that file from within my android project's OnCreate method using (in this case my PCL is called X):
var assembly = typeof(MainActivity).GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream("X.TestPage.xml");
This returns null. I have therefore tried looking on Stack for answers and found people using this statement to find the correct path:
Assembly.GetExecutingAssembly().GetManifestResourceNames();
However; this returns a completely empty string array - nothing AT ALL.
Any idea's why I can't find my file?
Rather obviously - just discovered that the .GetTypeInfo().Assembly; must be called against the correct assembly (a class from within the PCL). "Brain Melt"?