Skip to content

How to set Repository in custom nuspec #1392

@jherby2k

Description

@jherby2k

I'm using a custom NuSpec file with an SDK project like this, and can't get sourcelink to work correctly.

.csproj snippet:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <NuspecFile>Pack.nuspec</NuspecFile>
    <NuspecProperties>$(NuspecProperties);Repository=$(RepositoryUrl)</NuspecProperties>
  </PropertyGroup>

</Project>

Pack.nuspec snippet:

<?xml version="1.0" encoding="utf-8"?>
<package>
  <metadata>
    <repository>$Repository$</repository>
  </metadata>
</package>

But the repository isn't set in the resulting .nupkg's .nuspec file. Any tips? Is this possible?

My other projects in the same solution (which don't need a custom Nuspec) have it set just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions