If you cannot find the source file, try using Reflector to decompile a newly created DLL containing this class. This will not give you your complete source, but at least it will give you something to start with.
Note. The reflector is no longer free; If this is important, try dotPeek from JetBrains.
Also learn about using a source code management system . This will allow you to “copy” versions of your code into the repository, so you will have a copy if something like this happens in the future.
Subversion , Git , Mercurial are popular; In my opinion, Subversion will be the easiest to start, especially with TortoiseSVN (OS integration) and AnkhSVN (Visual Studio integration). If you don’t want to worry about setting up a repository / server, look at a hosted solution, such as Beanstalk , which offers Subversion and Git, and you can try it with a free limited account.
Good luck - I hope you can restore your source!
Jeff ogata
source share