praeclarum / FuGetGallery

An alternative web UI for browsing nuget packages
https://www.fuget.org
MIT License
683 stars 121 forks source link

Dynamic vs cached results? #123

Closed dcuccia closed 3 years ago

dcuccia commented 3 years ago

This might be a feature vs a bug, but thought I'd give a heads-up. At the moment, I'm having trouble pulling the MobileBlazorBindings templates with the command:

dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview

The error returned is:

Determining projects to restore... C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp1.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\dcucc.templateengine\dotnetcli\v5.0.100\scratch\restore.csproj] Restored C:\Users\dcucc.templateengine\dotnetcli\v5.0.100\scratch\restore.csproj (in 1.33 sec).

Investigating further, I checked for any newer versions here:

https://www.nuget.org/packages/Microsoft.MobileBlazorBindings.Templates

...and saw nothing new there. For fun, I checked Fuget:

https://www.fuget.org/packages/Microsoft.MobileBlazorBindings.Templates

...and received an "Error Reading Package" notice:

System.IO.InvalidDataException: End of Central Directory record could not be found. at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) at FuGetGallery.PackageData.Read(MemoryStream bytes, HttpClient httpClient) in D:\home\site\repository\Data\PackageData.cs:line 118 at FuGetGallery.PackageData.PackageDataCache.<>c__DisplayClass2_0.b0() in D:\home\site\repository\Data\PackageData.cs:line 412 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b278_1(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at FuGetGallery.PackageData.PackageDataCache.ReadPackageFromUrl(PackageData package, HttpClient httpClient, CancellationToken token) in D:\home\site\repository\Data\PackageData.cs:line 412 at FuGetGallery.PackageData.PackageDataCache.GetValueAsync(String arg0, PackageVersion arg1, HttpClient httpClient, CancellationToken token) in D:\home\site\repository\Data\PackageData.cs:line 385

I am assuming this discrepancy is due to a lack of a cache, and likely by design/scope. But thought I'd mention it here if it's useful. Perhaps a more graceful user-readable fallback could enhance, but maybe not the highest ROI given the target audience are "power users."

Cheers! David

svick commented 3 years ago

I think this would be solved by https://github.com/praeclarum/FuGetGallery/pull/121. As described in that PR, if you manually select a version, the error goes away: https://www.fuget.org/packages/microsoft.mobileblazorbindings.templates/0.5.50-preview.

dcuccia commented 3 years ago

@svick looks like it, thanks! So, not necessarily related to the template install failure, after all.

praeclarum commented 3 years ago

Hi! I think this is working now. Please re-open if not. Obviously I can do better with the display of Razor files.