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 (ping please)
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
ZacharyPatten3y 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 (ping please)
Thats what you get when you blindly copy stuff that dont work. Thanks a lot for pointing out my mistake
ZacharyPatten
ZacharyPatten3y ago
@Ole did that fix your issue? if yes, I will close this ticket feel free to open another
Ole (ping please)
Yes, sorry for not stating it explicitly. It needs to be embedded resource and copy makes no sense in this context
ZacharyPatten
ZacharyPatten3y 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
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server