0

When building my solution, I randomly receive one of these errors:

C:\working_directory.nuget\NuGet.targets(91, 5): Type handle 'NuGet.ProjectModel.LockFile' and method handle with declaring type 'NuGet.ProjectModel.HashCodeCombiner' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase. C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command ""C:\working_directory.nuget\NuGet.exe" install "C:\working_directory\Project_A\packages.config" -source "https://www.nuget.org/api/v2/" -NonInteractive -RequireConsent -solutionDir "C:\working_directory\ "" exited with code 1.

C:\working_directory.nuget\NuGet.targets(91, 5): Common Language Runtime detected an invalid program. C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command ""C:\working_directory.nuget\NuGet.exe" install "C:\working_directory\Project_B\packages.config" -source "https://www.nuget.org/api/v2/" -NonInteractive -RequireConsent -solutionDir "C:\working_directory\ "" exited with code 1. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

C:\working_directory.nuget\NuGet.targets(91, 5): The signature is incorrect. C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command ""C:\working_directory.nuget\NuGet.exe" install "C:\working_directory\Project_C\packages.config" -source "https://www.nuget.org/api/v2/" -NonInteractive -RequireConsent -solutionDir "C:\working_directory\ "" exited with code 1.

C:\working_directory.nuget\NuGet.targets(91, 5): Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'NuGet, Version=3.5.0.1938, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Index not found. (Exception from HRESULT: 0x80131124) --- System.BadImageFormatException: Index not found. (Exception from HRESULT: 0x80131124) C:\working_directory.nuget\NuGet.targets(91, 5): --- End of inner exception stack trace --- C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command ""C:\working_directory.nuget\NuGet.exe" install "C:\working_directory\Project_A\packages.config" -source "https://www.nuget.org/api/v2/" -NonInteractive -RequireConsent -solutionDir "C:\working_directory\ "" exited with code 255.

C:\working_directory.nuget\NuGet.targets(91, 5): Abstract method with non-zero RVA. C:\working_directory.nuget\NuGet.targets(91, 5): error MSB3073: The command ""C:\working_directory.nuget\NuGet.exe" install "C:\working_directory\Project_D\packages.config" -source "https://www.nuget.org/api/v2/" -NonInteractive -RequireConsent -solutionDir "C:\working_directory\ "" exited with code 1.

This used to happen only on one machine, now another machine is seeing the same problem.

This issue is not persistent , I can successfully build my solution after rebuilding for a few times. I've also tried "Clean Solution" but it does not fix the issue.

I'm not sure what's wrong since the errors are random and not persistent :(

Can someone shed some light? I am using VS2015, another machine using VS2013 also experience the same issue now.

4
  • 1
    Which Nuget.exe version do you use? Commented Jan 15, 2018 at 13:01
  • @CSharper Looks like I'm using 3.5.0.1938, let me try the latest recommended v4.4.1 Commented Jan 15, 2018 at 13:10
  • BadImageFormatException can happen if you try and load a 64 bit DLL into a 32 bit process. Commented Jan 15, 2018 at 14:00
  • I was seeing this issue every so often with version 3.5.0.1938. I upgraded to the latest (5.1.0.6013) and I have not seen the problem since. Commented Sep 3, 2019 at 16:31

1 Answer 1

0

I have just run into this. In my case, it was a disk space issue. Check the free space on your C:\ ???

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.