Click here to Skip to main content
15,881,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to MVVMCross, tring to read a file from resource folder. Any ideas?

What I have tried:

var assembly = typeof(Assembly).GetTypeInfo().Assembly;
string[] resources = assembly.GetManifestResourceNames();
Stream stream = assembly.GetManifestResourceStream("QueueResponse.txt");
but getting resources as empty.
Posted
Updated 21-Apr-16 22:18pm

1 solution

I think you need to prefix the filename "QueueResponse.txt" with the namespace of the Assembly, ie

C#
Stream stream = assembly.GetManifestResourceStream("MyNamespace.QueueResponse.txt");


obviously MyNamespace != your name space - use the actual value the assembly was built with
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900