I came across a challenge last week, wherein I was asked to remove the path information from the dll files which were build inside my project.
For those who don’t have an idea about what I am talking about, here is a quick introduction. The dll/exe files which are build by Visual Studio contains the Win32 PE header information, and this is true for all the dll and exe on Win32 platforms. Read about it at (http://en.wikipedia.org/wiki/Portable_Executable)
To check the headers in your dll/exe files you can use the dumpbin tool.
So you can see the full path of the PDB file is embedded inside the DLL file, which is the point of concern as you might not want to expose private information in your releases. Fortunately this can be avoided by using the linker argument “/PDBALTPATH:%_PDB%” which just embeds the filename of PDB instead of full path. Unfortunately, this is true only for VC/C++ and there is no way to use this method when you are building C# assemblies.
Reference:
http://www.debuginfo.com/examples/debugdir.html
I used the code provided in above article and tweaked it to make it more user friendly. My code is variant of DebugDir.cpp written by Oleg Starodumov.