When opening this file, are you opening it in Visual Studio, or an external editor?
NCrunch will respond to changes on the file system. If you're using an external editor and it creates a resource lock file or something else on the file system that is being watched by NCrunch, this can trigger a build.
Edit: If you're using VS to edit the file directly (i.e. as XML), it's possible that loading the file into memory in VS actually causes a change in its structure. VS may be formatting the file differently to how it is physically stored in disk (in binary form). This difference causes NCrunch to naturally trigger on the file. You can probably identify the nature of this change by reading the file as it exists in the NCrunch workspace (right click the project, go to advanced->browse to workspace) and comparing it with its equivalent in your foreground solution using a hex editor/comparison tool.
I opened it from inside Visual Studio. Opening such files from external editors doesn't trigger NCrunch to build the assembly.
It seems opening the same xlf file a second time doesn't trigger NCrunch to build.
Comparing both files from disk with KDiff3 shows me that they are binary equal.
But comparing content (copied from VS Code or VS 2022) from both files with KDiff3 shows me that they have equal text but are NOT binary equal.
I identified some other embedded files (*.json files) which have the same problem.
I use KDiff3 to compare both files (from solution folder and from NCrunch workspace folder) in two different ways:
[list=1]
Opening the files directly by KDiff3 (in menu File -> Open)
KDiff3 says both files are binary equal
Opening the files in an external editor (Notepad++, VS Code, VS 2022)
"Files A and B have equal text, but are not binary equal."
I don't understand why NCrunch is triggering a build although both files are binary equal on disk.
I don't understand why just opening both files, copy & paste content just change some binary data.
I'm able to reproduce this issue by
- just creating a new .NET project in Visual Studio
- adding a JSON file to the project
- enabling NCrunch on the solution
-- then every time you close the JSON file
-- restarting the NCrunch engine
-- opening the JSON file will trigger NCrunch to build the assembly