Attention: We are retiring the ASP.NET Community Blogs. Learn more >

[.NET C#] Embedding Resources Into Your Assembly Manifest

While integrating some code, yesterday, I discovered how to embed resources "files" - such as JPG or GIF images, htm files and xsl files - into your assembly manifest.  You can then access them via reflection.  The first article to examine about this is John Gallardo's Embedding and Using Resources in C#.  After that, read up a bit more in Chris Sells' Microsoft .NET Framework Resource Basics

When you are done, you will know about untyped manifest resources and typed resources (stored in resx files).  One advantage of the manifest approach is that you can bundle resources into an assembly that you can distribute to be used in some host application without having to introduce a bundle of files into the host's solution tree.  This is a very cool and useful feature.

1 Comment

  • I found this URL when I tried to figure out why my hbm.xml file was not included in the Assemly. The links in the message helped solve this problem. Thanks a lot.

Comments have been disabled for this content.