I have a project that contains regular resources in Properties\Resources.resx. Next to that, I have a folder named Scripts containing files, marked as "Embedded Resource". When I do:

var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();

I get a list of resources, containing both. What I would like to have is a list of "Scripts" resources only. I tried the following code, but set always contains null. Hope anybody can shed some light onto this.

var manager = new ResourceManager("<namespace>.Scripts", Assembly.GetExecutingAssembly());
var set = manager.GetResourceSet(CultureInfo.InvariantCulture, true, false); 

Recommended Answers

To confirm, at the time of writing this isn't currently possible.

My alternative ended up building an entire framework around Embedded Resources so that I could do such filtering at run time, effectively performing LINQ on a set of objects which returned the keys of all the items in a …

Jump to Post

All 2 Replies

After numerous tries I give up. I don't think the way I want to use this is supported. I'll be sticking to my work-around.

To confirm, at the time of writing this isn't currently possible.

My alternative ended up building an entire framework around Embedded Resources so that I could do such filtering at run time, effectively performing LINQ on a set of objects which returned the keys of all the items in a specific location. Then I returned them one by one into a collection that gets passed back to the caller.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.