How update NuGet Package Manager? - visual-studio-2012

I have the same problem as in topic: Can not install NuGet package . I suppose that I should update my NuGet Package Manager. I try to make it as described here: https://docs.nuget.org/docs/start-here/installing-nuget . But in updates I have not items. Thus my question is how can I update my NuGet Manager? I can not find good instructions. I am using Visual Studio 2012 (Express edition for Windows Desktop).

Related

Unable to configure Microsoft Identity Platform while publishing .Net Core 3.1.4 project + VS 2022 + Azure

I have a .net core 3.1 project. The project has a dependency on Microsoft Identity Platform and SQL Server.
While publishing the project to Azure. I am not able to configure the Microsoft Identity Platform. It gives below Error window.
I am able to configure SQL Server dependency but not sure why it is not able to configure Identity Platform.
I am using
.Net core 3.1.4
Visual Studio Community Edition 2022
Asp.net core Identity Entity Framework 3.1.4
Any idea?
Because you didn't install the dotnet-msidentity tool.
You can try to open the cmd black window and execute this command following this document.
dotnet tool install Microsoft.dotnet-msidentity -g --version "1.0.0-preview.1.21212.1"
This command will solve your issue. But then you will meet another issue like screenshot below if your account has multiple tenant.
Someone met this issue too and raised a ticket to ms.
You may search for known issues here if you meet some other weird questions when using vs2022.
dotnet tool uninstall --global Microsoft.dotnet-msidentity
dotnet tool install Microsoft.dotnet-msidentity -g --version "1.0.2"
worked for me
if you have nuget problems make sure you habe a nuget.config in the directory you are running the command
Make sure nuGet is set as the first or default package source in Visual Studios.
Right click on the project, click on manage nuGet packages and click on the gear next to Package Source.
Verify that nuget.org is setup as the first package source.

How to upgrade nuget packages if the installed version is missing?

Running into a situation where I deployed an application to production a few months ago and now I need to do some work on it, on an entirely new machine. The first I do is pull source and nuget restore won't restore because it can't find the particular version of the package it was developed under. When I check nuget.org for this package version it is not there. So how do I upgrade my solution to the latest binaries?
Visual Studio 2013 trying to update ServiceStack '4.0.39' to latest, which is '4.0.40' at the time of this post.
Thank you,
Stephen
The best solution I've come up with for this is to manually edit the Packages.config file(s) and set the version number to whatever you want. Restore should then work. It's not a perfect solution but it has dug me out of some holes.
(I know this is an old answer, but it just came up in some Googling)
One issue with the accepted answer (of just updating the version # in packages.config) is that this is just triggering a "package restore"--and will skip any "installation steps" the package might have (things that were done automatically when you first added the package, such as adding assembly references, modifying config files, etc.).
An alternative way would be to edit the packages.config and REMOVE the package in question from there---then start up VS and add the new version. This will trigger the package's usual install routine to do it's thing.
I recommend you to use the NuGet Package Manager Console of Visual Studio:
TOOLS > NuGet Package Manager > Package Manager Console
Command to update a NuGet package to the latest version:
Update-Package ServiceStack
Command to update a NuGet package to a specific version:
Update-Package ServiceStack -version 4.0.40

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

Adding NuGet AdDuplex AdControl to windows phone 8 project

I tried to add the AdDuplex AdControl in Visual Studio 2012 for a Windows Phone 8 app by following this Link.
But it shows the error in the image.
How could i install this Adduplex pack into the project.
In Your VS 2012 Tools => library package manager => CLick package manager console
Now Enter
PM>Install-Package AdDuplexWindows
The issue (most likely) is that you are adding this to a project that used to be a Windows Phone 7.x project, right? In this case nuget gets confused and displays this error.
A fix is to remove all the nuget references from your project and re-add them.
I had the same issue. Fixed it by updating NuGet first:
http://docs.nuget.org/docs/start-here/installing-nuget
"Updating NuGet in Visual Studio"
After updating NuGet I was able to install AdDuplex.

Adding NuGet ndef library to windows phone 8 project

So I tried to add the NDEF library for proximity application in Visual Studio 2012 for a Windows Phone 8 app. In Package Manager I checked Allow NuGet to download missing packages during build and in the Solution Explorer I selected Enable NuGet Package Restore.
So far so good, but when i try to install the package I get the following error:
Could not install package 'NdefLibrary 0.9.0.1'. You are trying to install this package into a project that targets 'WindowsPhone,Version=v8.0', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.
This works fine on my dev box. Here's the output from my NuGet package manager on a WP8 project:
PM> Install-Package NdefLibrary
You are downloading NdefLibrary from Andreas Jakl, the license agreement to which is available at https://ndef.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'NdefLibrary 0.9.0.1'.
Successfully added 'NdefLibrary 0.9.0.1' to Wp8TestApp.
What you're probably missing is to update your NuGet package manager to the latest version. Go to Visual Studio File Menu --> Tools --> Extensions and Updates --> Updates --> Visual Studio Gallery --> NuGet --> Update and finally you'll need to restart. The reason why this update is needed is that the NuGet version that ships with VS2012 RTM doesn't support WP8 since WP8 didn't RTM before VS2012 did.

Resources