NuGet Package Manager not working in Visual Studio 2017 - for a.NET Core 1.1 web application - visual-studio-2017

I just created a .NET Core Web Application in VS2017 and I wanted to be able to serve a single page application. In order to be able to do that I tried to install the nuget package Microsoft.AspNetCore.StaticFiles. But my NuGet installer failed and threw the following error
Severity Code Description Project File Line Suppression State
Package restore failed. Rolling back package changes for 'MyApp'.

Right click on the project=>Properties and set TargetFramework to .net core 2.0(less than or equal to the packages version you are using)
build the project and then install whatever you want from nuget.

Related

Error trying to install latest nuget pkg Aspose.Cells

Trying to install the latest Aspose.Cells package in VS 2019. Had a buddy try the same thing, same error. Have a license. What am I missing?
Severity Code Description Project File Line Suppression State
Error The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Aspose.Cells.22.3.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
Unable to find package 'Aspose.Cells.22.3.0'.
I tested your scenario/case. I created a new console application in VS.NET 2019. Then, I clicked on Tools|Nuget Package Manager|Manage Nuget Packages… option. Now I searched Aspose.Cells (v22.3.0) after clicking Browse link. I then installed the latest version and it works fine. I do not get any error during the import process as well.
The issue might be due to NuGet Package Manager configuration on your end. You may clear NuGet cache and give it a try in your VS.NET again.
PS. I am working as Support developer/ Evangelist at Aspose.

Unable to restore nuget packages on Sitecore8.2 build

I'm trying to setup a MVC 5 Sitecore 8.2(helix) project but not able to restore the Nuget packages.
This is the error I get when installing from command line
Restoring NuGet package Sitecore.Foundation.SitecoreExtensions.1.0.7.
WARNING: Unable to find version '1.0.7' of package 'Sitecore.Foundation.SitecoreExtensions'.
[14:11:41] Unable to find version '1.0.7' of package 'Sitecore.Foundation.SitecoreExtensions'.
Trying from Visual studio I get this
I have added the following package sources Nuget v2, Nuget v3, Sitecore v2, Sitecore v3
I upgraded my Node version to Node-v10.20.1-x64 and gulp version 6.14.4 but the error still occurs.
That package no longer exists on NuGet. It's from Habitat which is no longer maintained and probably never should have been released to NuGet in the first place. I would recommend adding the extensions that you are using into your own foundation project.

The nuget command failed with exit code(1) The element <ProductVersion> beneath element <Project> is unrecognized

I'm setting a build in Azure DevOps Pipelines, I have in repos some solutions including a SQL Server Analysis Project. This project triggers a error in the build for the NuGetCommand:
[error]The nuget command failed with exit code(1) ...: error MSB4067: The element <ProductVersion> beneath element <Project> is unrecognized.)
[error]Packages failed to restore
[section]Finishing: NuGetCommand
Any ideas how to solve this error? Maybe run the NuGetCommand for all projects except this SSAS, how can I exclude this solution/project?
I tried to Manage NuGet Packages for this SQL Server Analysis Project, but is not supported.
I have this code in the azure pipeline, I need to run this command for every solutions except SQL Server Analysis Project.
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
The nuget command failed with exit code(1) The element beneath element is unrecognized
This issue is more related to the MSBuild instead of nuget.
Since NuGet is now fully integrated into MSBuild, when we invoke nuget to restore packages, it will call MSBuild auto-detection. There is a issue in MSBuild 15 about it.
Besides,
the latest version of Microsoft Reporting Services Projects for Visual
Studio (1.18) adds MSBuild support for SSRS projects. With this
installed, SSRS projects can be updated to a format supported by
MSBuild, which prevents this problem from happening.
So, to resolve this issue, please update your Visual Studio on the agent server to the latest version to check if you still have this issue.
Hope this helps.

Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing new package

I get Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing a new package. In particular I am trying to install the dropbox API, but I tried several other packages and get the same result.
I install by right clicking on the project and choosing Manage nuGet Packages... Then I select the package and click Install.
The NuGet is able to connect with the NuGet server as the package seems to download. The download information flashes on the screen pretty quick so I captured it with screen recording software to see if there were error messages. There were none.
I updated visual studio 2017 to latest patch level. My windows 10 machine is also at the latest level.
The project I am trying to install into is a freshly created Console App(.Net Core).
Here are the other questions I looked at:
Package restore failed. Rolling back package changes
does not have any responses because it is not a well developed question.
package restore failed rolling back package change for ' myproject' in vs 2017 .net mvc core project
Yet another poorly worded question with no viable answers.
Package restore failed. Rolling back package changes for 'myproject' in vs 2017 in MVC Core
That one is trying to update packages, not install new.
Nuget - Package restore failed. Rolling back package changes for 'WebApplication1'. 0
Seems to be for a custom package.
I am new to using Visual Studio.
To expand on #Michael Potter's answer, create a Console App (.NET Framework), NOT Console App (.NET Core).
The problem was that I am using Console App(.Net Core) Core is not compatible with Dropbox API.
I figured that out by opening NuGet Package Manager -> Package Manager Console and running Install-Package Dropbox-Api.
Then the error message about compatibility was on the screen plain to see.
To solve the problem I am switching to Console App (.Net Framework).
bring the version of the solution package to 1.1.3enter image description here

SlowCheetah - TeamCity - [restore] Unable to find version '2.5.15' of package 'SlowCheetah'

I have an issue with my TeamCity instance not retrieving version 2.5.15 of SlowCheetah from TeamCity. It restores all of my other nuget based dependencies just fine.
I added SlowCheetah to one project in my Solution via the Nuget Package Manager Console and it works fine locally. However when TeamCity tries to get the nuget package is complains with
[restore] Unable to find version '2.5.15' of package 'SlowCheetah'.
I've had a look at adding a nuget installer - https://johanleino.wordpress.com/2013/06/17/making-use-of-teamcitys-nuget-capabilities-part-2/
and this
http://sedodream.com/2011/12/12/SlowCheetahXMLTransformsFromACIServer.aspx
neither of which work.
Any ideas?
I believe you need to update your Nuget version on TeamCity.