How to make sure nuget never update itself automatically? - nuget

I want to use Nuget in a situation where it should not update itself automatically. How can I configure / enforce this?
It seems Nuget is sometimes updated automatically. From the documentation it seems it is only a matter of not using the -Self option. But this seems to be incorrect. How can this be disabled?
In the Visual Studio Nuget options dialog there is a "Automatically check for updates" checkbox. Where is this setting stored?
Is there some setting / trick to "pin" the Nuget version explicitly?

To turn off the automatic check for updates, go to the NuGet settings dialog and uncheck Automatically check for updates.
This feature was actually added in NuGet 1.3, but would not be visible, of course, until an update to 1.3, such as NuGet 1.4, was made available.

Related

Disable omnisharp-vscode's "project selector" feature

I'm using vscode 1.58.0 and omnisharp-vscode 1.23.14.
The latest update introduced a feature of a dropdown that asks me to choose a project. All other projects are disabled, i.e. not analyzed by omnisharp. This forces me to continually switch between projects.
Can I load multiple projects at a time?
Better yet, can I can revert to the old behavior of loading all projects?
This was a bug, which the latest version fixed.

PostSharp is continually asking for "Some NuGet packages may need to be installed"

PostSharp is already installed to the package, or at least it's already been attempted to be added multiple times.
Instead, it warns on every compilation, and on top of that "add PostSharp to project" doesn't disappear after the same action is executed, leading me to believe that the "Add PostSharp" action isn't completing properly.
How can this be manually installed to get around this OR
Can we just fix PostSharp so the add issue is removed (eg the bug is fixed)
You can validate which of your projects have PostSharp NuGet package installed with the "Manage NuGet Packages for Solution..." dialog box. You can also try to re-install the packages using the same dialog and see if it fixes the issue.
The "Some NuGet packages..." PostSharp dialog box can be disabled with "Do not show this dialog" check-box. The option is also available in "PostSharp" -> "Options" -> "Advanced" -> "Disable NuGet dependency verification before build".
Normally, the project that has PostSharp NuGet package installed should not appear in this dialog.

Visual Studio checks out all projects file after enabling of the nuget package restore

I enabled nuget package restore and now every time I restart VS2013 all project files in my solution(over 200) are checking out. I disabled automatic restore, but it didn't help. Is there any way to fix it?
Go to the .nuget folder in your solution, and look for the file NuGet.Config,
in the file change the attribute disableSourceControlIntegration value to true or false, according to your needs.

Entity Framework NuGet package not source-controlled/in TFS?

I mapped my solution (using Entity Framework) onto a new PC. The solution reports a compile error because the EntityFramework.dll can't be found. Digging deeper it seems that TFS only stores the packages/repositories.config file in source control. I'm unable to re-add the Entity Framework as VS2012 reports it as already installed (green tick).
What's the normal process to fix this? Is this a wider issue with source-control and NuGet packages? Should I just add the DLL to source control?
FYI, the HintPath is for the project is: ..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll which of course doesn't exist.
My current workaround is to hack the 'packages.config' to delete the EF item and then go back into the NuGet dialog.
If you right click your solution you should have the option to "Enable NuGet Package Restore" - this should sort your issue out.
You may also need to right click your solution and got to "manage nuget packages etc..." - it may give you an option to restore missing packages.

NuGet Source Control Integration

I checked out my project using git and saw the assembles I installed with NuGet as missing. I tried building and got a missing assembly error so I tried to re-add it with NuGet but NuGet says I have added that dll/reference to my project (it has a green checkmark).
I went into the options and checked get missing ref during build and did a rebuild and I am still getting missing asm errors.
How do I use NuGet with source control?
Right Click Solution (and projects) -> Enable NuGet Package Restore
or...
Check the packages folder into source control.
YMMV, NuGet is terrible at integrating with source control.
What exact error are you seeing with package restore ?
http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages - has more details around enabling package restore.
[For the benefit of those who land here via a web search]
As of NuGet 2.0, "Restore Packages" is a step that can be performed by the build before attempting to build your solution:
See this from official NuGet docs
Enabling package restore for a solution can be done through Visual Studio GUI and the changes made to the project are similar to what #Precipitous suggests in his comment. In essence you do this:
Right click on the solution in Visual Studio and click "Enable NuGet Package restore".