Deleting Packages Folder during Migration - c#

When I type the code in the console and run it it deletes the current packages folder.
What should I do?
I'm trying to create a migration folder

Related

Create nuget package which displays Readme.md file upon installation

I am trying to create a nuget package from .net6 project xml file. I have added README.md into the project file. When I install the package in another project, I want the README file to be copied to the output directory. Since I m working with pipelines, I am directly creating packages from project file without separately creating nuspec file. Is there a way to add some property in the project file which enables copying readme files upon installation of package?

Is there a command to point nuget.exe to a specific NuGet.Config file?

I am trying to install Nuget packages via the cmd because our program runs on multiples VMs which chosen randomly. Some of these VMs have Nuget installed and have a NuGet.Config file which installs the packages in a folder my project cannot detect.
I created my own NuGet.Config and put in the root of my project folder, I tested it locally and everything works fine. I want something like "nuget.exe -configfile NuGet.Config" so that the packages will be installed in my project folder as I configured. Any help?
Yes. Based on the docs, the NuGet CLI accepts an option to indicate which config file to use. The syntax goes as follows:
nuget.exe restore -ConfigFile <a-path-to-the-config-file>
In your case:
nuget.exe restore -ConfigFile .\NuGet.Config
Based on the details on your question, the "restore" part was all that it was missing.

How to load EF tools from another folder into package manager console?

We're creating a global architecture for all products of our company, and we've come to have a very specific file-system structure in which packages folder should not be in the root of solutions directory.
Of course we can reference EF dll files from somewhere else, because it's configuration is done in csproj file.
However, when we delete packages folder, add-migration breaks, because it depends on the tools existing in the tools folder.
Is it possible to add paths to Nuget package management console? or is it possible to use add-migrations out of PMC, or do we have any other choice?
Based on our experience we think it should be possible, but we can't find out how.

NuGet Package Restore Issue

I need NuGet to automatically restore packages. At the moment, the referenced dlls are missing.
I have enabled package restore on my solution.
The .nuget folder is checked in.
The packages.config file is checked in for each project.
The packages folder (on solution level) is check in.
The packages folder contains folders for all the packages the solution uses with nuspec and nupkg files for each package. The dll is not checked in.
In VisualStudio the packages are installed but the reference to the dll in each project is missing (ass the dll is not checked in).
I have tried to install NuGetPowerTools. Same story.
Thanks,
There is no reason to check-in anything underneath the packages folder. Optionally, you can check in the repositories.config file but technically this is not required.
Do I get it right that you have checked-in the nuspec and nupkg files within the Packages folder? if so, delete them. These will be restored, and their presence might be causing restore failures (I don't think NuGet package restore is checking for the presence of the package contents, and rather checks for the presence of the nupkg/nuspec file in the Packages folder, skipping the package from being restored if found)
In summary, check in only:
The empty solution level packages folder (optionally the repositories.config)
.nuget folder and its contents
packages.config for every project
I have got this problem in Visual Studio 2015 Update 3.
Found a solution that worked for me:
Went in to the user profile NuGet cache
(C:\Users\<username>\.nuget\packages\), and deleted everything in
there.
I think during the restore process my cache was cleared of all DLL
files, and when I tried to install a package it was using the cache
instead of the files off of NuGet. Now that I've cleared the cache, I
can now install the NuGet packages.
This is almost the same symptoms as I had once, and then the cause was the permission level on packages.config. Deleting the file solved it for me.
I have no idea if it will help you, but have a look at the permission sets for all the files.
Same here, deleted config and re-referenced all the packages. Think it has something to do with SVN.

How to make nuget create folders in the project?

Is there a way to add specific folders in the project that the package is installed?
For example, according to this blogpost you can add multiple files to the project, but what I want to add are folders. I added folders in the content folder before I create my nuget package, but the folders are not added to the project after the package is installed.
Thanks !
If you create a directory hierarchy in the content folder, nuget will replicate that in your project.

Categories

Resources