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."
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", "{...}"
...
WARNING : It seems that you can't work with JetBrains Rider IDE without visual studio!
This issue can happen with Rider IDE if you haven't also installed Microsoft's Visual Studio, along with relevant add-ons libraries dealing with your project (for example Xamarin).
Installing Rider + .NET Framework + MSbuild may not be enough to resolve the issue.
Perhaps it's obvious but not for everybody, in particular developers new to .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", "{...}"
...
This happened for me when my computer crashed while I had a solution open. When I opened it up again, nothing would build. None of the previously mentioned solutions worked. Here's what did:
.vs
hidden folderI'm using VS 17.
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.
In my case the .gitignore file was ignoring the Directory.Build and Directory.Build. The other teammate who left the company has copied the file from and old project.
© 2022 - 2025 — McMap. All rights reserved.