2

How do I 'clean' a Visual Studio 2010 C++ solution,

so that it is small enough to be zipped up and sent as an email attachment?

Is there any other way to send large MSVS C++ files over email?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 3
    E-mail does not impose any attachment size restrictions. – n0rd Jan 04 '12 at 10:25
  • Email is neither a file transfer protocol nor a source repository. Have you considered using a [distributed version control system](http://git-scm.com/)? – johnsyweb Jan 04 '12 at 10:28
  • 1
    See also http://stackoverflow.com/questions/2143956/gitignore-for-visual-studio-projects-and-solutions for a good list of files that you don't need to distribute with your source. – johnsyweb Jan 04 '12 at 11:19
  • @n0rd you are actually wrong. It's a defacto, given truth that across the vast majority of SMTP servers, the maximum mail size is 10MB. – George Apr 14 '13 at 17:49

3 Answers3

3

For making size smaller:

  • Visit each project's folder and delete everything from their bin, obj, Debug and Release folders (or delete the folders themselves).

Notice: If some files have been manually put in the bin folder by the developer for the program to work make sure you don't delete it. If it's not your own project: Normally there are files of type exe, pdb, ilk, lib, dll, exp, vshost.exe, manifest, that can be safely deleted. But if you see other things, such as mdf or mdb databases, images, text files, etc they shouldn't be deleted.

  • At the root of the solution or project there might be a big .ncb file which is Intellisense's database and can be safely deleted since it is recollected next time you open the project. A user options file with .suo is there that contains the environment and editor's layout and settings. This can be deleted too but it's usually small.

  • Finally, make sure you use a good archiver. Zip is very common but is not as good as formats like gzip, bzip2 or 7-zip.

Sending projects via e-mail is nice to send your homework to the professor, but as others noted if this is a team work, you must consider using some (distributed) version control system among your team.

Hossein
  • 4,097
  • 2
  • 24
  • 46
  • You're right, I haven't seen it before :blush: But now I tried it, and it didn't delete the `.ilk` link file, the `.ncb` database and `buildlog.html`. So still cleaning manually frees up more space. – Hossein Jan 05 '12 at 10:38
  • Yes, it doesn't delete all files. In VS 2010, it leaves .sdf files as well. – Jaywalker Jan 05 '12 at 12:40
1

Instead of sending projects by e-mail, you should consider sharing them through some kind of source code management system (SCM) like Subversion, Git, Mercurial or whatever else.

n0rd
  • 11,850
  • 5
  • 35
  • 56
1

When you run a Build -> Clean Solution in VS 2010, it deletes almost all of the temporary files as in this Clean up C++ projects article.

Jaywalker
  • 3,079
  • 3
  • 28
  • 44