How to add/remove github dependancy with paket? - paket

The docs say the command requires a package ID
My paket.dependencies looks like this:
source https://api.nuget.org/v3/index.json
nuget Xamarin.Essentials 1.0.1
nuget Xamarin.Forms 4.0.0.425677
github dotMorten/XamarinFormsControls
And I can successfully remove a nuget with paket remove Xamarin.Essentials, but paket remove dotMorten/XamarinFormsControls don't work
How can I remove a github dependancy with paket remove? And also, how can I use paket add to add a github dependancy - without manually editing the paket.dependencies file?

Related

Looking for buildspec commands to restore dependent dll's from multiple nuget sources(2 private nugets) in AWSCodePipeline's build stage

I tried following things :
adding the following prebuild command:
dotnet nuget add source -- path of the nuget link
adding the nuget.config file in the root repo of AWS code repository.
The errors I get are as follows :
failed to retrive the dll from the nuget path..
Actually we are using 2 private nuget sources and the packages get downloaded rightly.
But when the project is building it searches for the dll in wrong nuget source .

Files Not Appearing In Solution Explorer

I am using Visual Studio 2017. I created an empty ASP.NET Core Web Application, and then installed the nuget package for Bootstrap through the Nuget Package Manager Console and the bootstrap .css and .js files aren't showing up in the solution explorer. Is this a bug or is there more to using nuget?
the bootstrap .css and .js files aren't showing up in the solution explorer. Is this a bug or is there more to using nuget?
That because the usage of NuGet for css/javascript libraries is discouraged. You should use the npm (Node Package Manager) to add the JavaScript libraries instead of using NuGet. The newer project file formats, PackageReferences, only supports files that are in a contentFiles directory inside the NuGet package.
To use the package Bootstrap to the .net core project, you need to select your ASP.NET Core Web Application and add a new file to the project root. While in the template manager (Add->New Item...), search for "npm Configuration file":
Then edit the file and add your dependency, i.e.
package.json (npm) or bower.json:
"dependencies": {
"Bootstrap": "4.1.3"
}
Note: Once you save, the file will be downloaded in a directory named "node_modules`. This alone won't be enough, as the required files need to be copied over to wwwroot folder, where they can be accessed when the application runs.
For the detailed info, see NPM, BOWER, NUGET, GULP – The Four Horsemen of ASP.NET CORE Apps and ASP.NET Core 2.0 and the End of Bower.
Hope this helps.
Content in the NuGet file that gets put into your project is only supported with packages.config, which is not supported in .NET Core. PackageReferences do not support getting content from the package.
I'm not 100% sure, but I think the ASP.NET team's recommendation is to use the preferred distribution method of the content you want to use. I haven't kept up with web development trends, but a few years ago web content like bootstrap were distributed with npm, so that's my recommendation for you. Creating a new Angular JS app with Microsoft's new web app template includes a npm package.json, so I think using npm is a safe bet.

Installing NuGet package located in local package repository into a new Visual Studio Solution

UPDATE: Apparently providing too much pre-amble adds more confusion that clarity, so here's my question:
How do I add packages to a project from the local packages repository (i.e. not the central NuGet repository) when there are no references to them in the current solution and thus they do not show up as installed in the "Manage Package for Solutions" window.
Original with the background detail:
We use a local NuGet package folder that contains all the packages to be used by our projects. We do NOT want it to be arbitrarily updated or changed (i.e. no Installs of existing packages or restore's (if possible))
We've recently switched to VS2017 and are building our solutions and projects from scratch. We set up a NuGet.Config to point to the local packages folder. It works (as in we see new packages installed there if we test-install a package into a project from the NuGet central repository).
However, because the NuGet packages are currently not installed into any projects in the solution, NuGet reports (via Get-Package or the GUI) that there are no packages installed.
This seems to mean that we can't add the projects in the packages directory to the appropriate solutions without going to the central NuGet repository, despite their availability in the local package folder!
I'd prefer to see the package in the repository so that I can add them to their respective projects and have NuGet create the packages.config file for the project (using the new format).
Do I really have to re-install the packages from NuGet's central server just to add them to a project?
Installing from the central NuGet repository literally writes over the existing package in the local repository. More to the point, a few of our packages use versions that are no longer available on the NuGet repository.
Our current work-around is to editing the packages.config file by hand in one project in the solution, which makes the package visible in the "Manage Package for Solutions" window. We then can install the package in our actual target project by simply selecting the target project in the GUI (this performs the appropriate alterations on the target project's .csproj file). We then remove the hand-edited packages.config from the original project.
This is using NuGet 4.6 as installed by VS 2017.
Many thanks for any advice.
How do I add packages to a project from the local packages repository (i.e. not the central NuGet repository) when there are no references to them in the current solution and thus they do not show up as installed in the "Manage Package for Solutions" window.
Not sure if I completely understand your problem correctly, if not, please let me know for free.
To resolve this issue, you can create a local feed for those packages, so that you can see those packages in the Manage Package for Solutions and add them to their respective projects and have NuGet create the packages.config file for the project even if you don't have them installed.
Add those packages .nupkg into your local repository folder (Including those versions that are no longer available on the NuGet repository).
Head into Visual Studio and open the NuGet Settings dialog via Tools > NuGet Package Manager > Package Manager Settings. Click the Package Sources tab within the settings dialog, followed by the plus icon in the top left to add a new package source.
Enter the Name and Source of your local repository. The name can be any string and will be the name displayed in the NuGet Package Manager within Visual Studio.
Now that you have added the local package source, you will be able to use your local repository from within Visual Studio in the usual way, either via the Console or via the Package Dialog, by selecting it from the Package Source menu:
Hope this helps.

Nuget Custom package Restore from URI on Build Server

Could anyone suggest me the best way to restore custom Nuget packages on a build server after a TFS build definition is triggered.
Whether to pass the packagesource URI through nuget.config, or restore it using powershell
You could install your custom Nuget packages by right clicking the project in VS -- select Manage NuGet Packages, and check in the packages.config file.
Then, in your TFS build definition, add a NuGet Installar task before VS Build task to restore the packages.

SlowCheetah - TeamCity - [restore] Unable to find version '2.5.15' of package 'SlowCheetah'

I have an issue with my TeamCity instance not retrieving version 2.5.15 of SlowCheetah from TeamCity. It restores all of my other nuget based dependencies just fine.
I added SlowCheetah to one project in my Solution via the Nuget Package Manager Console and it works fine locally. However when TeamCity tries to get the nuget package is complains with
[restore] Unable to find version '2.5.15' of package 'SlowCheetah'.
I've had a look at adding a nuget installer - https://johanleino.wordpress.com/2013/06/17/making-use-of-teamcitys-nuget-capabilities-part-2/
and this
http://sedodream.com/2011/12/12/SlowCheetahXMLTransformsFromACIServer.aspx
neither of which work.
Any ideas?
I believe you need to update your Nuget version on TeamCity.