Sometimes it’s necessary to embed a resource file in the assembly in order to make the distribution easier, or to protect the resource file.
In order to set the resource as embedded, it’s necessary to change the “Build Action” to Embedded Resource:
Then, on the code, it’s just a matter of getting the resource stream from the assembly.
Note: It’s necessary to use the namespace before the filename: “Namespace.Filename.extension”
Assembly assem = this.GetType().Assembly; Stream stream = assem.GetManifestResourceStream("Namespace.Filename.extension");