loic-sharma / BaGet

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

Fix: Error if README is in a subdirectory #785

Closed david-m77 closed 4 months ago

david-m77 commented 10 months ago

Error if README is in a subdirectory when pushing a package.

2023-09-11 10:58:04 fail: BaGet.Core.PackageIndexingService[0]
2023-09-11 10:58:04       Uploaded package is invalid
2023-09-11 10:58:04 System.IO.FileNotFoundException: docs\README.md
2023-09-11 10:58:04    at NuGet.Packaging.ZipArchiveExtensions.LookupEntry(ZipArchive zipArchive, String path)
2023-09-11 10:58:04    at NuGet.Packaging.ZipArchiveExtensions.OpenFile(ZipArchive zipArchive, String path)
2023-09-11 10:58:04    at NuGet.Packaging.PackageArchiveReader.GetStream(String path)
2023-09-11 10:58:04    at NuGet.Packaging.PackageReaderBase.GetStreamAsync(String path, CancellationToken cancellationToken)
2023-09-11 10:58:04    at BaGet.Core.PackageArchiveReaderExtensions.GetReadmeAsync(PackageArchiveReader package, CancellationToken cancellationToken) in /src/BaGet.Core/Extensions/PackageArchiveReaderExtensions.cs:line 32
2023-09-11 10:58:04    at BaGet.Core.PackageIndexingService.IndexAsync(Stream packageStream, CancellationToken cancellationToken) in /src/BaGet.Core/Indexing/PackageIndexingService.cs:line 56

Example