Alex Rivera | Logout

What's difference between the two build actions "Resource" and "Embedded Resource" in Visual Studio 2010?

Asked 2011-11-07T11:35:19.433
8

I have read the following article which supposed to explain it, but it does not help me:

http://msdn.microsoft.com/en-us/library/ht9h2dk8(VS.80).aspx

My case is that I would like to have a dll which contains hundreds of icons. And the icons dll will be shared and used in various applications. Obviously, I would not like all those icons to be loaded in memory if one application just use tens of them. So I'm interested to know if "Resource" (the build action) would allow me to load icons on demand instead of loading all at once.

Could anyone help?

Edit
Report

1 Answer

2

Build action "Content" might be what you are really searching for. In this mode the icons won't be part of your executable which will thus load faster.

The documentation for "Resource" and "Embedded Resource" says:

In either case, the resource data is compiled into the executable file.

So with any of the "Resource" build actions they will be loaded to memory what is not what you want.

Click here for a comparison of "Content" and "Resource" action.

answered 2011-11-07T22:22:01.683

Your Answer