Visual Studio Nuget packages - visual-studio-2019

Am trying to get nuget packages into my visual studio project.
NuGet Package manager is not package source of 'nuget.org'... just show Ms VS offline packages. Is there any setting?

got this working, just need to add:
https://api.nuget.org/v3/index.json
Nuget in the Package Souces.

Related

F# Can't install nugets because doesn't find default nuget source

I'm trying to install some nuget packages using vs code in F# interactive (fsx script). It has worked before because I have successfully installed FSharp.Data, but it seems to not work (anymore).
Following error
No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org (vs code)
Code
open System.IO
open System
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
#r "nuget:System.Data.Linq.dll"
#r "nuget:FSharp.Data.SqlClient.dll"
A related issue says to list the nuget sources through commandline:
Visual Studio 2019 F# NU1101 Unable to find package FSharp.core
When I do this I get a correct response:
So what is going on here?
When You use nuget prefix in the #r directive, you don't have to add ".dll" extension at the end of package name. It is required only when you are referencing local dlls.
https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/

Fresh install of VS Enterprise 2019 missing AspNetCore and Azure packages

I've just did a fresh install of Visual Studio 2019 Enterprise on Windows 11. No previous VS installations.
Upon creating a new project (in this instance Azure Functions) I am getting errors that packages such as AspNetCore, and Azure are not available.
I have the required SDK's installed as can be seen from the image below:
Here is an image showing the errors in the editor:
What I don't understand is I didn't have this issue when I was running Visual Studio Community edition on Windows 10. I did a fresh install yesterday.
I also noticed that under Tools -> Nuget Package Manager -> Package Manager Settings I only have an offline source listed. Should there be a URL to pull packages online?
I'm not sure how to solve this. I've did a repair, and a fresh installation and I still get the same issue.
I figured it out. There was no online package source defined for nuget.
First, head to Tools -> Nuget Package Manager -> Package Manager Settings. Click the Package Sources tab.
Press the green + button to add a new source. Enter the following settings:
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
Like so ...
If like me you have a project open that's missing packages simply hit the build button and Visual Studio will restore the missing packages.

How to configure older version of package with packages available on TFS server

I have a VS 2008 file that runs on my computer perfectly fine and does everything it needs to do. When I update the TFS version of it its copies exactly, just as you'd expect. However when I build my solution on TFS it can't find a package in my packages folder in my project folder.
This all makes sense, the .gitignore has it set so that packages in the project are removed (unless necessary), and my company uses nuget to deal with all common 3rd party packages used. That being said, how do I get a reference to the package (with appropriate version) from the TFS server to my code on TFS?
P.S. This is my first time dealing with this tech so apologies if the lingo is being misused. Thanks!
How to configure older version of package with packages available on TFS server
If you are using the TFS version is 2015 or above, there is NuGet Installer or NuGet Restore task, which you could use to restore the nuget package from the package source to the work directory when you build your project:
Check the document Azure Artifacts and NuGet restore Vs NuGet installer.
If you are using the TFS version is 2013 and below, you can
check the document Integrate NuGet Package Restore TFS Build 2013 or Older to restore nuget packages.
Hope this helps.

Can not install SignalR client nuget package for MonoDroid

I was trying to install Nuget package for MonoDroid project (Visual Studio 2015):
Microsoft.AspNet.SignalR.Client
And I got this error:
Could not install package 'Microsoft.AspNet.SignalR.Client 2.2.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.3', but the package does not contain any assembly references or content files that are compatible with that framework.
Any idea to sort this out?

Can't install Websharper nuget

When i'm trying to create a sitelet project, nuget fails on installing
NuGet Package restore failed for project To2a1.PublicSite.WebSharper: Could not find file 'C:\Users\Michakun\AppData\Local\Temp\nuget\atxvmxdn.eba\tools\net40\IntelliFactory.WebSharper.Web.dll'
Anyone knows why? I'm using visual studio 2013 update 4

Resources