C
C#2y ago
Ole

Getting unexpected result when trying to load resources [Answered]

I am trying to load some embedded resources, but it does not behave like I expected.
var resources = Assembly.GetExecutingAssembly().GetManifestResourceNames(); //
//returns "AssetEditor v0.40.g.resources"
var resources = Assembly.GetExecutingAssembly().GetManifestResourceNames(); //
//returns "AssetEditor v0.40.g.resources"
Any idea what I mess up?
7 Replies
Ole
Ole2y ago
It works fine if I embed the resource in a dll, but if I do it from the main exe project, I get the above.
ZacharyPatten
ZacharyPatten2y ago
you should probably be using Embedded Resource rather than Resource I forget the difference off the top of my head but I always use Embedded and don't copy to output directory if you are going to have an embedded resource.... why would you copy?
Ole
Ole2y ago
Thats what you get when you blindly copy stuff that dont work. Thanks a lot for pointing out my mistake
ZacharyPatten
ZacharyPatten2y ago
@Ole did that fix your issue? if yes, I will close this ticket feel free to open another
Ole
Ole2y ago
Yes, sorry for not stating it explicitly. It needs to be embedded resource and copy makes no sense in this context
ZacharyPatten
ZacharyPatten2y ago
so you ready for me to close this thread? It seems like you are good. I'm closing this. feel free to reopen if needed
Accord
Accord2y ago
✅ This post has been marked as answered!