20

I'm working on a project which we'll call Container. Container has a bunch of EmbeddedResources. The original files for these EmbeddedResources are another project which we'll call FileProject.

FileProject is a project that is currently being worked on by a group of different developers and is always changing, so I have my EmbeddedResource files linked - so that whenever the original project changes and I do a rebuild of my project, it picks up the changes.

This setup catches whenever a file changes, but it doesn't catch whenever a new file is added or removed from the project. Is there a way to make EmbeddedResources out of an entire folder structure in Visual Studio to catch file removal and additions?

Victor Chelaru
  • 4,491
  • 3
  • 35
  • 49
  • Are you guys using SVN inside of VS? e.g. http://ankhsvn.open.collab.net/ Seems like this would be a great start for multiple engineers working on a shared project. – Christopher Marshall Jan 24 '12 at 21:24
  • I may have misunderstood the question though. – Christopher Marshall Jan 24 '12 at 21:25
  • Massive amounts of embedded resources are a really poor substitute for a setup.exe file. Have you ever run SysInternals' VMMap on your process? A .zip file would be a simple approach to solve this particular problem. – Hans Passant Jan 24 '12 at 21:27

1 Answers1

38

Edit the project file for Container in a text editor and find the <EmbeddedResource> elements that link to the files in FileProject:

<EmbeddedResource Include="..\FileProject\Copy.bmp">
  <Link>Copy.bmp</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\FileProject\Paste.bmp">
  <Link>Paste.bmp</Link>
</EmbeddedResource>

Delete all of these elements and replace them with a single <EmbeddedResource> element that has a suitable wildcard:

<EmbeddedResource Include="..\FileProject\*.bmp" />

Now if you add Cut.bmp to FileProject, it will also show up in Container.

Michael Liu
  • 52,147
  • 13
  • 117
  • 150
  • 3
    This approach works although the newly added files show up in .csproj file with Build action Content but they also act as EmbeddedResource in practice. – Mr.Hunt May 24 '16 at 08:05