I have a Portable Library which I am using for a Windows Phone application. In that same Portable Library, I have a couple of content files (Build Action = Cont
First of all, retrieve your assembly like this (DataLoader being a class in your PCL assembly) :
var assembly = typeof(DataLoader).GetTypeInfo().Assembly;
Add your file to portable resource and set build action to Embedded Resource.
Then you can retrieve your ressource like this :
string resourceNam= "to be filled";
var assembly = typeof(DataLoader).GetTypeInfo().Assembly;
var compressedStream = assembly.GetManifestResourceStream(resourceName));
For example if I have a file logo.png in a folder "Assets/Logos" in an assembly "TvShowTracker.Helpers" I will use this code :
string resourceNam= "TvShowTracker.Helpers.Assets.Logos.logo.png";
var assembly = typeof(DataLoader).GetTypeInfo().Assembly;
var compressedStream = assembly.GetManifestResourceStream(resourceName));
Happy coding :)