How to resolve Visual Studio (MSBuild) error message:
Error occurred while restoring NuGet packages: "Invalid restore input. No target frameworks specified."
How to resolve Visual Studio (MSBuild) error message:
Error occurred while restoring NuGet packages: "Invalid restore input. No target frameworks specified."
WARNING : It seems that you can't work only with JetBrains Rider IDE without visual studio !
This issue can also be happen with Rider IDE if you don't install alongside the Visual Studio solution of Microsoft with all addons libraries dealing with your project.
Because install Rider + .NET Framework + MSbuild JetBrains no solving the issue.
Perhaps is obvious but not for all in particular new developers of world of .NET coding.
The problem was caused by wrong project type specified in .sln file. In the solution file the project had type {D954291E-2A0B-460D-934E-DC6B0785DB48} (Shared Project / Windows Store App Universal).
...
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SomeProject", "SomeProject", "{...}"
...
But actually the project is C# (SDK project). The problem was solved by changing the GUID/UUID in the solution file to the correct one, which is {9A19103F-16F7-4668-BE54-9A1E7A4F7556}.
...
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SomeProject", "SomeProject", "{...}"
...
I had this error recently in a project which builds a NuGet package targeting multiple frameworks.
In brief, I had this in my .csproj file (presumably a git merge error):
<TargetFrameworks>netstandard2.1;net462;net48;net48</TargetFrameworks>
Note the duplicate entry for net48. The odd thing was that it still built on my machine (presumably due to something being cached on disk somewhere). Once I removed the duplicate entry everything started working again.