4

I've been trying to figure out all day how JetBrains's Rider sets the .nupkg version and other metadata.

I can't seem to find any configuration window on the whole IDE to do this, or if I have to have a special file with the data on my project.

The .nupkg data always defaults to the following (where MyProjectName is the name of my project) whenever I use Rider to "Pack Solution" or "Pack Selected Projects":

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>MyProjectName</id>
    <version>1.0.0</version>
    <authors>MyProjectName</authors>
    <owners>MyProjectName</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package Description</description>
    <dependencies>
      ...
    </dependencies>
  </metadata>
</package>

I've looked at Microsoft's Docs for Packages and JetBrains Rider Help, but none gave me any hint at what must be done.

I'm using Rider 2017.3.1 on my Ubuntu 14.04.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
cavpollo
  • 4,071
  • 2
  • 40
  • 64

1 Answers1

6

After googling around to no avail, I found out that I should modify the .csproj file. Also, as @xtmq pointed out, the Microsoft .Net Core docs specify which are the available tags recognized as NuGet metadata properties.

So for example, we could add the values inside the PropertyGroup section so that Rider generates the .nupkg file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>
      ...
    </TargetFrameworks>
    <Authors>cavpollo</Authors>
    <Version>1.0.1</Version>
    <Description>My project Description</Description>
  </PropertyGroup>
  <ItemGroup>
      ...
  </ItemGroup>
</Project>
cavpollo
  • 4,071
  • 2
  • 40
  • 64