How to compare dll files
I have a post-build script after building my C # project that will place one of the DLLs in a specific directory. This DLL is saved in SVN. My question is, is there a way that, when I build my project, knows that this DLL has not changed and will not be copied to the directory so that there is no modified copy of SVN?
source to share
The quick and easy way is to install both files and compare their modification times - only copy the file if the DLL in the destination directory is older than the one you are copying.
A more reliable but slower way is to use any number of diff programs to compare two bytes for bytes for libraries.
source to share
If I don't understand your question, you have nothing to do. If the file is not modified, SVN knows about it and will not commit.
Edit: You explained in response to Tim that you are doing this to save other developers from building problems. This is the wrong way to do it. Source control should not be used to store binaries that are output from the source. Instead, you should:
- get continuous integration working on your tree
- send all output from 1.to a shared folder
- notify all developers to view this part if they don't want to build something
source to share
SVN should already take care of this for you. If there is really no difference between the files and you replace them with another, SVN will not consider the file "changed" even if it has a new timestamp. SVN maintains a base version of the file and uses diff itself to determine which files need to be executed. Therefore you can always copy the dll and SVN will take care of the rest.
source to share
Try to commit anyway and see if SVN is consistent with your GUI.
If it tries to commit anyway, then whatever the file creates does include some different information each time (maybe a timestamp or something). You might want to actually commit as this file is different. You can check your compilation options to see if it contains some kind of timestamp, but if you cannot find such an option, it will be difficult to determine if the changes to the dll are meaningful or just some compiler metadata.
source to share
It is ok to check binaries in subversive way. The reason for this is that the downstream user (QA or user) may not have an environment to build from source. They are also not interested in generating source code.
The problem is that the building management issue is when you release this DLL and how do you track the source code if QA detects a problem with your DLL.
Timestamping is not a reliable method.
For this you need something in building management. In my project, our building script defines the maximum version number of the files (note that this is not the current version number, as you will be able to build in the future but still get the same results). It then puts that number into the DLL version resource. After we are satisfied with the result, we free it by manually copying the binary to the folder in subversion and registering.
If QA encounters an error, we can always go back to the state that the DLL built (by looking up the version number) and find where the problem is.
source to share