My application is running as a windows service and I'm attaching VS2013 to it's process to debug. I'm getting the hash code for the content of image files to check for differences with the following method (within a static class):
static class FileUtils
{
public static int GetFileHash(string filePath)
{
int hash = 0;
Logger.WriteLog(ToolTipIcon.Info, "Calculating hash code for {0}", filePath);
StreamReader sr = new StreamReader(filePath, Encoding.Unicode);
hash = sr.ReadToEnd().GetHashCode();
sr.Close();
return hash;
}
}
Which has been working fine in production. However, this method will always return 2074746262 for two different images. I've tried to reproduce this in a winforms app with the same code and images and I can't. Is there something with debugging a process in VS2013 that would cause this behavior? I've replaced one of the images with an entirely different image, but it still happens.