Skip to content

Instantly share code, notes, and snippets.

@SlowLogicBoy
Created December 5, 2017 10:22
Show Gist options
  • Save SlowLogicBoy/56769cfd66803c0d2608688c8bd08859 to your computer and use it in GitHub Desktop.
Save SlowLogicBoy/56769cfd66803c0d2608688c8bd08859 to your computer and use it in GitHub Desktop.
Nuget.Client repo with csproj.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Client" Version="4.2.0" />
<PackageReference Include="NuGet.Configuration" Version="4.4.0" />
</ItemGroup>
</Project>
using System;
using System.Linq;
using NuGet;
using NuGet.Configuration;
using NuGet.Repositories;
namespace CSProjs
{
class Program
{
static void Main(string[] args)
{
var repo = new NuGetv3LocalRepository(SettingsUtility.GetGlobalPackagesFolder(Settings.LoadDefaultSettings(null)));
var packages = repo.FindPackagesById("NuGet.Client");
var pkg = packages.Last();
var nuspec = pkg.Nuspec;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment