Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


How to Embed Resource Files in .NET Assemblies

Use .NET's ability to embed XML files, icons, graphics—anything you want—directly into your assemblies.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

his article describes how to use .NET's ability to embed XML files, icons and other files in an assembly so your code can access them at run-time. Embedding the files helps you avoid problems commonly associated with external files, such as missing files, difficulty locating the files at runtime, and issues with upgrading and versioning. The ability to embed resources in an application file is not new, but the mechanism for embedding files in .NET is different then for unmanaged code, so don't expect to be able to work with embedded resources in exactly the same way as you could in unmanaged code.

Microsoft itself frequently embeds resources in application files. For example, if you load an XML file into Internet Explorer (IE), it renders the file in a TreeView-style manner, using different colors for nodes, attributes, and text content. IE accomplishes that by using an embedded resource, an XSLT stylesheet. You can access the stylesheet using the URL res://msxml.dll/DEFAULTSS.XSL (you can type this straight into IE's address field to see the stylesheet contents).

Author note: You can't use this technique to access resources embedded within .NET assemblies, because the resource files are not stored in the same way.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date