When I build any of my WPF App projects, I often get this error:
"Unknown build error, 'The process cannot access the file '...\obj\Debug\GeneratedInternalTypeHelper.g.cs' because it is being used by another process.'"
In order to make the error go away, I must rebuild the project. Sometimes, the error persists, even if I rebuild many times. As far as I can tell, both its occurrence and its disappearance seem to be random.
A similar bug is reported here: Build error: "The process cannot access the file because it is being used by another process". That's a different problem because it concerns the project executable, while mine concerns GeneratedInternalTypeHelper.g.cs. Nevertheless, I've tried most of the suggestions posted there, including:
- Switch from Debug to Release and back (or vice versa)
- Close all designer windows before building
- Use Task Manager to close all instances of MSBuild.exe
- Manually delete GeneratedInternalTypeHelper.g.cs
- Restart Visual Studio
None of these measures reliably resolve the error. Can anyone suggest what else I might try?
Edit:
Solved. The problem was an extension called FastFind. The suggestion to run Visual Studio in SafeMode was the advice I needed. Thanks to everyone who posted a comment.
Further Edit:
I reported the problem to the developers of FastFind, and they fixed it in an update. Kudos to them.