Anyone know what is the correct way of referencing assets if the platform is ARM? In x86 I can use appX folder with linking but its not working on ARM
thanks
Anyone know what is the correct way of referencing assets if the platform is ARM? In x86 I can use appX folder with linking but its not working on ARM
thanks
If you want to get assets files from a .NET Standard library, you would need to mark the file as
EmbeddedResource
andCopy Always
.Then, you need to add a method to get these files in your .NET Standard library's class. For example:
Please note this line
assembly.GetManifestResourceStream("ClassLibrary1.Assets.dog.jpg");
The
ClassLibrary1
is the namespace, theAssets
is the Assets folder in the library project, thedog.jpg
is the file.In my sample, I put the image files in the Assets folder, if put it in root directory of project, then, this line should be like this:
assembly.GetManifestResourceStream("ClassLibrary1.dog.jpg");
You could use the following code to see all embedded resource:
After that, in your main project, you could call this method to get these files.