Resolved How to Embed a Resource

aaaron

Well-known member
Joined
Jan 23, 2011
Messages
216
Programming Experience
10+
I'm looking at Net 5 build Action in Properties and it looks like Embedded Resource is not there.

I spent much of yesterday looking for an Internet hit to explain but most hit show how to use a resource not how to embed it.

Is the embed concept gone?

Is there a way in Net 5 to embed a text file for example?
 
I see lots of build actions including that. Is your VS updated?

Also, have you considered using the application resources?
 
Solution
I do.

As is using application resources. Open the Resource page of the project properties, add an existing file as a resource and then access the data in code via My.Resources. Nothing difficult about that.
I shouldn't have mentioned the easiness.

The better question is do you prefer that way.
 
The better question is do you prefer that way.
That's the same question you already asked and I already answered. Mind you, it's not necessarily that I evaluated both and decided one was better but rather that I have always used that option and have found it to be simple and effective and so have seen no reason to do anything else.
 
I'm curious about the same thing and would like an answer that makes sense.
I just added a text file to a .NET 6 WinForms app project and checked the Build Action property and Embedded resource was in the list of options. I would like a question that makes sense. Please be specific. What exactly did you do and what exactly happened that you didn't expect or didn't happen that you did expect? If you're not talking about something you did, what are you talking about? Don't assume that we will know what "the same thing" is because several specific things have been discussed here so we would have to guess which one you mean, or you could tell us.
 
Back
Top