Domanda

For a week now, I've been getting random build errors which make no sense at all. At first, I issued another build until no error appeared. But now the frequency has become too high to tolerate.

The errors appear alternatively and are as follows:

  • error MSB3249: Application Configuration file "app.config" is invalid. Could not find file 'XXX\app.config'.

    The weird thing about this one is that the project asociated to XXX does not have an app.config (it's a native C++ dll). Also, XXX alternates projects.

  • error MSB3027: Could not copy "YYY.dll" to "bin\x86\Debug\YYY.dll". Exceeded retry count of 10. Failed. 1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(3540,5): error MSB3021: Unable to copy file "YYYdll" to "bin\x86\Debug\YYY.dll". The process cannot access the file 'YYY.dll' because it is being used by another process.

    These always come in pairs. Looking into this with Process explorer, that other process is always MSBuild.exe or devenv.exe. Figures.

  • Some projects could not be loaded. I tried to reproduce this to copy the error message but the frequency is too low now.

  • Deadlock/Starvation: Build gets stuck in the "Build Started" line and I have to cancel it. When I do that, some of the previous errors show up.

My environment: Windows 8.1 64 bits, Visual Studio 2012, Resharper 8.2, Solution with 98 projects (C#, VB.NET, C++/CLI and C++)

I tried rebuilding, cleaning, opening and closing VS, restarting Windows, disabling Resharper and restarting VS. With this last fix the errors went away but I miss the nifty R# stuff. I'll look into the R# issue tracker, but did anyone else experience this? Some workaround other than disabling R#?

È stato utile?

Soluzione

ReSharper recently switched the way it resolves references - it now uses msbuild instead of core Visual Studio to resolve some things. There are several things you could try:

  1. Install the latest ReSharper 8.2.1 version (RC was released today, April 25th, fixes tons of issues related to build errors)
  2. Go to ReSharper options, General, and at the bottom, uncheck the Use msbuild to obtain project references option. Then try rebuilding.

If the latter solves your problem, I suggest you open an issue on the ReSharper issue tracker, so they can fix it.

Hope that helps!

Altri suggerimenti

I had a similar problem (random build errors). This would occurs in two solutions I've tested. The errors would always include a 'file not found' or 'access denied' type of error. The errors would occur using ReSharper 8.2.0.2160, but upgrading to ReSharper 8.2.1000.4556 fixed the problem (rolling back to ReSharper 8.0.1000.2286 also fixed the problem). I haven't tried playing with the 'MS build' option mentioned above.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top