1

I have a C# project with a great deal of image files in resources. The compilation these resources takes about 30 seconds each time I build the project.

I am wondering if it's possible to configure Visual Studio 2010 to prevent resource compilation if there was no changes in them.

Thanks.

UPDATED

Thanks a lot for help. The problem has been solved as follows. I changed persistence property from «Linked at compile time» to «Embedded in .resx» for all my resources.

Ronnix
  • 310
  • 4
  • 12

2 Answers2

2

Create resource file explicitly and embedded into your assembly. Moee detail , kindly refer the below link Creating Resource Files

Thiru kumaran
  • 1,262
  • 1
  • 10
  • 10
0

In Visual Studio:

  • Select all images
  • Open properties Windows (F4)
  • set Build Action to Content
  • set Copy to Output Directory as Copy if newer

enter image description here

balexandre
  • 73,608
  • 45
  • 233
  • 342
  • This solution achieves the "only if newer", but changes the resources from being embedded in the dll to being in folders beside the dll. If this is acceptable, perfect. Note that since "build" specifically creates the dll anew, and since "embedded resource" sticks things into said dll, there's no such thing as "avoid resource compilation if it didn't change". There is such a thing as "don't rebuild the dll if nothing here down changed", but that means all files in all dependent projects as well. – robrich Apr 28 '12 at 08:51