Find Change in CSProj Before Commit without Custom

2019-09-16 02:00发布

问题:

My question is somewhat related to this: Visual Studio 2013 Pending Changes does not include newly added item

I have one csproj file that is already checked in. Now somebody add some new file to project like class file or some resource file. As I am working in disconnected to TFS newly added file is not detected as change until I go to source control and add file.

Problem is somebody check-in the CSProj file without new file so at build server it get failed because he/she forgot to add newly added file because it is not detected automatically.

Is there any way we can check integrity of CSProj file before it get check-in so build will not get failed for this reason ?

Note : I want a way without any custom development like Policy or something.

回答1:

TFS can't check integrity of CSProj file before it gets check-in. You could use a Gate-check in build. When you do a check, this build definition will run. If this build succees, it will check in code, if it failes, it won't check in your code. This will give you a remind and force to your add those missing class files.