How To Detect Files Which Aren't Being Used in My Build
I have a ton of files in my source repository which aren't even u开发者_如何学编程sed in my build. I know a few of them, but I know that there are a ton more. Our build script is pretty antiquated and is a mish-mash of MSBuild, .BAT file, Perl and more. Can anyone tell me if there is a way to run my build, and then output a list of all the files which WEREN'T read as part of it?
Your best bet without writing code to hook into Windows is to use a tool which monitors disk activity. For example you could Process Monitor from the Sysinternals suite.
When you launch Process Monitor to the menu item Filter->Filter... which will pop open a dialog. In that dialog you should filter the results to only show activity under the path where you are building. In my example I created a dummy solution under the folder C:\temp_NET\ThrowAway\WebApplication2. So in order to filter to results only under this folder I added the filter shown in the image below.
After you do this you should run a build, then export the results from process monitor to a file and mine that file for modifications.
I would make sure that you are doing a full build, because if you are not then files may not be touched because targets might get skipped if they are up to date.
精彩评论