VS2017 The operation failed as details for project could not be loaded

NugetVisual Studio-2017

Nuget Problem Overview


I edit the project.csproj. and re-open the solution the errors occurred: The operation failed as details for project xxx could not be loaded

I try delete obj & bin folder, clear the nuget cache by tool>options. but the error still exist.

Remark: the error do not occur each time, i just restart the project three times. the first and second is correct. but the third the error occur

vs2017: Microsoft Visual Studio Community 2017 Version 15.0.26228.9 D15RTWSVC Microsoft .NET Framework Version 4.6.01586

Package Manager Console Host Version 4.0.0.2323

Nuget Solutions


Solution 1 - Nuget

I've faced the problem several times, and all but one were solved by just closing and then restarting visual studio 2017. So if you've not, please try restarting VS, then if that fails, look for more serious solutions.

Solution 2 - Nuget

I've just had the same problem. Microsoft are apparently aware of the problem and have fixed in the preview of the next release, see the following comment for details:

https://developercommunity.visualstudio.com/comments/31393/view.html

In the meantime, the workaround is to open VS2017 (without loading your solution), open the Package Manager Console, wait for it to fully load, then open your solution.

Solution 3 - Nuget

I came across the same issue in VS 2017 with lastest .NET SDK updates. But here is a quick and easy fix that i was able to find.

While your project is open, open your 'Package Manager Console' and then run 'dotnet restore' command.

In the Package Manager Console window, make sure 'Package Source' dropdown on the top is set to 'All' and 'Default Project' is set to your project name

Solution 4 - Nuget

Just restarting Visual Studio 2017 can be enough to resolve this.

Solution 5 - Nuget

Similarly to @Keith it was a result of SemVer in my 2017 project file.

In the .csproj file I am using <PackageReference... Version="1.1.*" />. When the solution first loads Package Manager outputs the following:

Error occurred while restoring NuGet packages: The operation failed as details for project ProjectWebApi could not be loaded.

In VS 2017 15.2 (26430.14) it doesn't seem to cause any actual problems, the solution loads and builds just fine. If a more recent package version is available but not in the local .nuget cache it is downloaded and installed as part of the solution startup. I have not tested with pre-release or build metadata tags trailing the patch number.

Solution 6 - Nuget

This happened for me due to VS2017's poor support for SemVer. They sort of tried to start supporting it in project.json files, but when translating to .csproj they've managed to make something quite broken.

I had:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <Version>0.2.1-alpha</Version>
    ...

This is partially supported by VS2017, in that it compiles, but it breaks NuGet and has lots of other issues due to some parts of .NET recognising the SemVer suffix.

The fix was to remove the suffix:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <Version>0.2.1</Version>
    ...

Now NuGet works.

Solution 7 - Nuget

Possible Work Around

Try This: Change the location of your project to a simpler location. E.g. place it on your desktop.

Possible Reason: Perhaps it couldn't load because the path was an issue (Included spaces, special characters, etc?).

For reference:
My old path: C:\Users\Corey\Google Drive\College\Semesters\2018\Spring\CSIS 434 (Programming)\Projects\Project 1
My new path is: C:\Users\Corey\Desktop

Conclusion: From Andrew's solution, it looks like Microsoft is still trying to fix this problem. Regardless, this work around may work for you!

Solution 8 - Nuget

I ran into this on a build server on Nuget restore. I turned out that the build pipeline used an old version of Nuget and broke after upgrading Visual Studio. Updating the Nuget version solved it for me

Solution 9 - Nuget

I found another issue causing this error as well.

If you add Package details for the project and specify the version with three digits, like 1.0.0 you will get this error.

If you specify the version as 1.0.0.0 the solution will build perfectly. I guess this breaks som internal validation as this will also set Version in the csproj-file.

TL;DR:

Do: <Version>1.0.0.0</Version>

Don't: <Version>1.0.0</Version>

UPDATE: Please see also Keith's answer.

Solution 10 - Nuget

Make sure that the AssemblyName tag value is the same as the RootNamespace tag value, inside the .csproj. This worked for me!

Solution 11 - Nuget

For me the solution path had an apostrophe and a space in it (C:/Users/[myName]'s PC/etc). I changed the path to just C:/ and it worked :)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCuiqsView Question on Stackoverflow
Solution 1 - NugetAlirezaView Answer on Stackoverflow
Solution 2 - NugetAndrew TreversView Answer on Stackoverflow
Solution 3 - NugetAbdiView Answer on Stackoverflow
Solution 4 - NugetrobyawView Answer on Stackoverflow
Solution 5 - NugetAaronView Answer on Stackoverflow
Solution 6 - NugetKeithView Answer on Stackoverflow
Solution 7 - NugetCorey PView Answer on Stackoverflow
Solution 8 - NugetSoundislateView Answer on Stackoverflow
Solution 9 - NugetJonas StensvedView Answer on Stackoverflow
Solution 10 - NugetSherifView Answer on Stackoverflow
Solution 11 - NugetZiadView Answer on Stackoverflow