Package restore failed. Rolling back package changes for "<project name>" in Razor web Project - razor-pages

I am Microsoft visual studio 2022.
When I tried to Scaffold Identity to my razor project there is an error that came "Package restore failed. Rolling back package changes for "".
I install the same versions of packages also. Attatched the Installed package and versions.. I couldn't figure out Error messagewhy that happen? Please help me.

Related

Visual Studio 2022 fails to load nuget packages from custom package repository

I'm using Visual Studio 2022 Update 17.3.3
I have some nuget packages in a custom store, maintained by my company. Accessing those packages used to work in the past. The way we set it up is generate a PAT on Azure ADO, and then use nuget to register them as package sources like this:
nuget.exe sources add -name mypackagerepo -password myPAT -username username#ourdomain.com -source https://pkgs.dev.azure.com/mycompany/_packaging/mypackagerepo/nuget/v3/index.json
A few days ago, Nuget Package Manager started to fail with the error
[mypackagerepo] Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/mypackagerepo/nuget/v3/index.json.
Response status code does not indicate success: 401 (Unauthorized).
If I open that link in a browser, I get HTTP 200 and a valid JSON response.
One series of steps to produce the error is
In VS / Tools / Nuget Package Manager / Manage Nuget Packages for Solution
In Package source, select the custom package source mypackagerepo
In the Browse tab, hit Refresh
VS displayes "Error occured"
Hit "Show errors in output"
The above error message is visible
I tried a bunch of things suggested by others
restarted VS
restarted my PC
removed my %appdata%/Roaming/Nuget/nuget.config file
created a new PAT and recreated the package source registrations
cleaned up (removed all VS related entries from) my credential cache
repaired then reinstalled VS
Any ideas how to fix it?

Is there a cloudscribe Getting Started Guide?

I'm trying to test if cloudscribe is appropriate for a project I am starting and I'm having challenges getting a cloudscribe instance running.
I'm new to .NET Core 2 and not quite sure how to make it work.
I loaded the VSIX template into VisualStudio 2017, started a new project and got the initial configuration dialogs, but when the project is created, it's getting errors:
Severity Code Description Project File Line Suppression State
Error NU1102 Unable to find package cloudscribe.Core.IdentityServerIntegration with version (>= 2.0.0-preview20170927)
- Found 20 version(s) in nuget.org [ Nearest version: 2.0.0-preview20170828 ]
- Found 0 version(s) in Microsoft Visual Studio Offline Packages cloudscribe c:\My Documents\Visual Studio 2017\Projects\cloudscribe\cloudscribe\cloudscribe.csproj 1
I really would like a robust identity & authentication, so I though the IdentityServer 4(fork) option was the way to go.
If I don't select Identity Server (and using NoDB), the project launches, but the login of admin#admin / admin doesn't work...likely because the database isn't populated.
What am I missing?
There was a missing package on nuget that was causing that error. Sorry for the inconvenience. It should be fine now. To make usre you have the latest nuget packages, open a command window in the root of the solution and run the command:
dotnet restore --no-cache

NLua nuget package restore failed in VS 2017

I am trying to create a .NET 4.6.1 Class Library an use this nuget package with it:
https://www.nuget.org/packages/NLua/
When I click install I get this message:
Package restore failed. Rolling back package changes for 'ClassLibrary1'.
If I try the same install with a web application in the same solution, the install completes successfully.
You are probably creating a "Standard" library, but if you want to add NuGet packages to it then you need to create a "Framework" library. At least that's how I got it to work.

NuGet; unable to get package as wrong version reported in Visual Studio 2012

I'm trying to build a solution but I get this error,
he 'Microsoft.Bcl.Build 1.0.14' package requires NuGet client version '2.8.1' or above, but the current NuGet version is '2.6.40619.9041'.
I've just upgraded NuGet package manager in Tools/"Extensions and Updates" which reports the version as 2.8.50313.31.
I've restarted VS2012, restarted the computer, cleaned the project and rebuilt, but I still can't get Visual Studio to recognise the new version and hence can't compile.
Thanks
Run Console (cmd) as Administrator
Locate your .nuget folder that contains the NuGet.exe file (you may check error message to locate the path)
execute this command NuGet.exe update -self
Took me all day to find that NuGet was bound to the individual project.
I had to use the package manager console and run
Install-Package Microsoft.Bcl.Build -Version 1.0.14
to get it to work manually.
Edit (5/11/2014). The problem is actually that Nuget gets bundled with the solution and it is this that needs upgrading. I did this by finding the directory in the project with the nuget.exe file in it (.nuget for me, YMMV) going to that directory and running nuget update -self. If you go with the original solution, you have to do this manually for each package. HTH.
This worked for me in VS 2017 Enterprise-
Right click your solution and go to "Manage NuGet Packages for Solution..."
In the window that opens up, click the gear icon at the top right corner.
Select "General" and click the "Clear Clear All NuGet Cache(s)" button. This will run for a few seconds depending on the size of your
cache.
Clean and rebuild your solution.

NuGet Package restore failed for project myProjectWeb: Unable to find version '3.0.1' of package 'AppForSharePoint16WebToolkit'

It's a provider hosted project. It used to work until very recently.
If I create a completely new project/solution, then it works.
If I start the old one, or redownload it from source control, I get the following error:
NuGet Package restore failed for project LocalTheaterWeb: Unable to find version '3.0.1' of package 'AppForSharePoint16WebToolkit'
I tried Update-Package -Reinstall but the problem stays.
Any ideas?
The solution of Scott Hillier did it for me:
http://www.shillier.com/archive/2014/08/05/nuget-package-restore-fails-for-sharepoint-2013-provider-hosted-apps.aspx
I often take advantage of the NuGet Package Restore capability to
reduce the size of my projects when saving or sharing them. Today, I
discovered an issue with this process when building SharePoint 2013
Provider-Hosted Apps against SharePoint Online. Here are the steps to
reproduce and the fix:
Create a Provider-Hosted App in Visual Studio 2013 using a SharePoint Online site for debugging.
Right click solution and "Enable NuGet Package Restore"
Save and Close Project
Delete the “packages” folder from project directory
Open Project in Visual Studio 2013
Rebuild, receive error “Unable to find AppForSharePoint16WebToolkit”
Open Packages.config file
Change “AppForSharePoint16WebToolkit” to “AppForSharePointWebToolkit”
Rebuild – successfully this time. Apparently, the "AppForSharePoint16WebToolkit" package is not available through the
NuGet Package Manager, but the older "AppForSharePointWebToolkit"
package is available.
The error message suggests that NuGet cannot find the AppForSharePoint16WebToolkit package in your package sources. So check the following:
The correct package source is selected whilst doing the Update-Package -Reinstall.
Check the package source that hosts the NuGet package is enabled. If you are using a recent version of NuGet the package restore should use all the enabled package sources.
See if the solution or project has its own NuGet.config which is overriding the package sources.
Without further information my guess is 3. since you say it works for a new project.
You can also run Fiddler to see what package sources NuGet is using as it tries to restore.
For older "locked down" projects with specific package version numbers that you can't update, un-check "Automatically check for missing packages during build in Visual Studio" which is found via:
Nuget Package Manager > Package Manager Settings
This means that if you toggle between newer projects and older projects you need to check and un-check this setting

Resources