0

I have a strange error. My solution (C++) has about 360 projects. When I build it using Visual Studio 2012, everything works fine. But when I build it using command line and devenv.com tool, I get an error MOST of times:

"Failed to write to log file 'D:...\AddonsRes.log' because it is being used by another process."

(the path is a 160 characters long existing path).

What's more, the error is ALWAYS on the same file. Nevermind if PC is just restarted or not. My machine is Windows 10 64 bit. It has 12 processor cores (visual studio build 12 projects at the time).

I know that Microsoft says that you should use msbuild instead of devenv, but msbuild has problems with building projects in right order.

So can anyone help?

Adam Jachocki
  • 1,897
  • 1
  • 12
  • 28
  • Do you use any 3rd party extensions in the build? Also, do you know which task is trying to access `AddonsRes.log`? This looks like a build concurrency issue.. you can avoid that by using `/m:1` (at least in msbuild) but that would probably slow down your build – Martin Ullrich May 15 '17 at 09:52
  • No extensions are used. I also don't have any idea what is trying to access this file. What's more, I tried to track it down using ProcessExplorer, but it seems that this file is NOT being used by other process :/ – Adam Jachocki May 15 '17 at 10:14
  • You can do a `/v:diag > diag.log` build to get a diagnostic log that shows which build step uses the file – Martin Ullrich May 15 '17 at 10:34
  • How about use the log switches, like: Devenv.exe /log "C:\My Files\MyLog.txt" ? Besides, Have you tried to build the solution after close the Visual Studio? – Leo Liu May 16 '17 at 03:05
  • Definitely seems like a concurrency issue. Are the intermediate folders the same? Is it writing to the same buildlog file for /ALL/ projects? ((Also, if MSBuild is building in the wrong order, and you are building the solution through MSBuild, then you might have set the dependencies wrong. But that's a different question)) – Biepbot Von Stirling Aug 11 '17 at 09:52
  • I am not using msbuild but devenv. Wha't strane, visual studio sometime show the same errors. Maybe there are some liner options that I could set or unset... – Adam Jachocki Aug 12 '17 at 13:31

0 Answers0