Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 112629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:34:29+00:00 2026-05-11T02:34:29+00:00

By default when you add an image (icon, bitmap, etc.) as a resource to

  • 0

By default when you add an image (icon, bitmap, etc.) as a resource to your project, the image’s Build Action is set to None. This is done because the image is magically stored inside a .resources file.

I want the resource to be stored as an embedded resource (my reasons are irrelevant, but let’s just pretend it’s so that I can see them inside RedGate’s Reflector).

So I changed each image’s Build Action to Embedded Resource, and the resource then appears inside Lutz’s Reflector – exactly as I want.

Unfortunately, Microsoft says specifically not to do this:

Note that when the resource editor adds an image, it sets Build Action to None, because the .resx file references the image file. At build time, the image is pulled into the .resources file created out of the .resx file. The image can then easily be accessed via the strongly-typed class auto-generated for the .resx file.

Therefore, you should not change this setting to Embedded Resource, because doing so would include the image twice in the assembly.

So what is the proper way to include an image as an embedded resource?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:34:30+00:00Added an answer on May 11, 2026 at 2:34 am

    Note: This answer is not the recommended way of handling image resources. It just addresses the particular problem as described by the question (i.e. to include an image as an embedded resourse).

    Don’t add the image as a resource. I would rather do the following:

    • Create the image/icon and save it to a file
    • Choose Project -> Add Existing Item and add the file
    • Set the Build Action to Embedded Resource

    You can then access this resource using

    Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceUri) 

    This way the image is not magically added to the projects resource file and you will only have one copy of the image stored in the assembly’s resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you include a script file A into a script… May 12, 2026 at 12:52 am
  • Editorial Team
    Editorial Team added an answer Functions without a name Simply put, a lambda is a… May 12, 2026 at 12:52 am
  • Editorial Team
    Editorial Team added an answer There is a general way to solve this sort of… May 12, 2026 at 12:52 am

Related Questions

I have a solution with many projects. One project contain few custom components. One
we're developing an iphone application to be distributed in Spain. It contains a Tab
When you double click on a class (in 'solution explorer')... if that class happens
It seems like when you have a WinForms .NET application, and a ComboBox (set

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.