简体   繁体   中英

TFS - perform a check-out + check-in of a certain file if another file is being checked-in

I have some XSD's files which I generate classes for using the XSD.exe utility from MS.

I use the pre-build to check-out the generated code classes file and the post to check back in.

Since there are several developers working on the same project and this is happening every time each decides to rebuild we keep getting conflicts on it which is not real conflicts (simply caused by a slightly different xsd tool version which is included somewhere in the header of the generated cs file).

To resolve this I wanted to first compare the XSD's content with the source server and only then perform the operation of the check-out + check-in.

Is there a way to do this using TFS?

Note: I tried using the diff command in the tf.exe but it does not return an exit code which i can use to know the result of the compare.

Any help would be much appreciated...

您可以使用tf.exe并对XSD文件执行get命令,如果返回“所有文件都是最新的”,则说明您不必进行检出/生成/检入处理

My advice would be to fix the cause of the problem rather than the symptoms.

When developing, you should try to have your developers and your build server all running with exactly the same set of tools and source code, so you know you'll all get consistent results. You cannot guarantee that the output from two different versions of a tool will always be identical/compatible. Simple mismatching version numbers are no problem, but what if the final program you generate has subtle differences depending on who built it? Fred may never be able to repeat and fix the bug that your customer is complaining of. Or you may think you've patched that major ATL security vulnerability until one day you realise you've been shipping product from a build server you didn't bother to patch.

It's a pretty simple matter to have a standardised install process (a "how to install" document that everyone follows carefully, a box containing the correct set of DVDs, and/or a network folder or source controlled folder containing the set of installers to be used, libraries to be linked to, etc)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM