I am having trouble with very slow builds in a solution with 12 projects out of which 7 have NuGet Package Restore enabled. The diagnostic output typically displays this:
[...]
9 ms ResolveProjectReferences 1 calls
18 ms _CleanGetCurrentAndPriorFileWrites 1 calls
32 ms CoreClean 1 calls
56 ms ResolveAssemblyReferences 1 calls
77 ms _CopyFilesMarkedCopyLocal 1 calls
400 ms CoreCompile 1 calls
9082 ms RestorePackages 1 calls
This is typical; RestorePackages usually takes 9-10 seconds for every project, and with 7 projects this adds a hefty 70 seconds to my build time. None of my colleagues who build the same solution has this problem. I have disabled all extensions and Visual Studio (2012) is up to date.
I have filed an issue on CodePlex, but I also want to ask this knowledgeable community in case there is a quickfix, and to seek help in troubleshooting this issue.
Edit: I completely removed NuGet -- the RestorePackages target is still being executed, and it still takes 10 seconds. I need to manually set RestorePackages = false in the csproj files to make this go away.
Edit 2: If I comment out the contents in the RestorePackages task in NuGet.targets the problem goes away too. Like this:
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<!--<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />-->
</Target>
It does not make a difference if I remove the CheckPrerequisites target.
Edit: I installed Windows 8.1, problem does not occur anymore.