loic-sharma / BaGet

A lightweight NuGet and symbol server
https://loic-sharma.github.io/BaGet/
MIT License
2.57k stars 639 forks source link

How to solve the problem of ProjectURL not displaying? #763

Open future0w opened 1 year ago

future0w commented 1 year ago

As stated in the title.

To Reproduce

Steps to reproduce the behavior:

  1. Here is my .csporj file.
    <Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    </PropertyGroup>
    <PropertyGroup>
    <PackageId>SysTools</PackageId>
    <Version>1.1.1</Version>
    <Company>OmniCode</Company>
    <RepositoryUrl>http://gitlab.omnicode.cn:30999/xxx.git</RepositoryUrl>
    <projectUrl>http://gitlab.omnicode.cn:30999/xxx.git</projectUrl>
    <Authors>SomebodyThatiUsedToKnow</Authors>
    <Description>Something</Description>
    </PropertyGroup>
    </Project>
  2. I first executed the command dotnet pack, and then executed dotnet nuget push -s http://Mysever/v3/index.json ./bin/Debug/MyPkg1.0.0.nupkg.

    Expected behavior

    I hope to be able to click on the Project URL on the webpage and be redirected to the corresponding project address, but that is not the case in reality.

cathalnoonan commented 1 year ago

Can you try using <PackageProjectUrl>...</PackageProjectUrl> instead of <projectUrl>...</projectUrl>.

PackageProjectUrl is the name of the property to use inside the .csproj file. https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target