We use release https://github.com/NuGet/NuGetGallery/releases/tag/v2020.06.09
When try to push package downloaded from nuget.org, get error:
Response status code does not indicate success: 400 (The <icon> element is not currently supported.).
Pushing System.Runtime.CompilerServices.Unsafe.4.7.1.nupkg to 'https://localnuget/api/v2/package'...
PUT https://localnuget/api/v2/package/
BadRequest https://localnuget/api/v2/package/ 2021ms
Response status code does not indicate success: 400 (The <icon> element is not currently supported.).
Hi, sorry for the late response. As a quick workaround, to enable icon support, please go to the "Feature Flags" page on the Admin section of the web site (/Admin/Features URL path) and add the following under "Flights":

The name of the flight is NuGetGallery.EmbeddedIcons.
We will make the code change so that will not be needed in the future. Apologies for the confusion.
Hi, thank you for response!
Is this exists a way to do same with .config files? (web.config or smth else)..
When i navigate to /Admin/Features i get Error 500 - Internal Server Error.
Details from log:
System.NullReferenceException
Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at NuGetGallery.Features.EditableFeatureFlagFileStorageService.<GetReferenceAsync>d__4.MoveNext() in C:\Code\NuGetGallery\src\NuGetGallery.Core\Features\EditableFeatureFlagFileStorageService.cs:line 37
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGetGallery.Areas.Admin.Controllers.FeaturesController.<GetModel>d__17.MoveNext() in C:\Code\NuGetGallery\src\NuGetGallery\Areas\Admin\Controllers\FeaturesController.cs:line 224
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGetGallery.Areas.Admin.Controllers.FeaturesController.<Index>d__5.MoveNext() in C:\Code\NuGetGallery\src\NuGetGallery\Areas\Admin\Controllers\FeaturesController.cs:line 38
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
All other links from /Admin works fine.
Any way, thank you for your help. I think, probably, i should try build NuGetGallery from master.. it have 87 commits from latest release.. so it's may be helpfull :)
I've compiled current master release: same issue, can't reach /Admin/Features, but all other links from /Admin wors fine.
You should be able to edit the App_Data\Files\Content\flags.json and add the following JSON object under Flights:
"NuGetGallery.EmbeddedIcons": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
}
Regarding the 500 you are getting, I didn't manage to reproduce it on my machine. Did you change Gallery.StorageType setting in web.config? What about Gallery.AzureStorage.* settings?
And to set some expectations: Gallery does not contain code to extract the icon from the package to display it on the package details page, it is done by catalog2dnx job. So, enabling that flight will only make Gallery accept such packages, it will not make it show actual icons that are inside packages.
Thank you! This is very helpfull option!
But.. i've make changes in App_Data\Files\Content\flags.json, restarted site.. (and IIS service too)
{
"Features": {
"NuGetGallery.Typosquatting": "Enabled",
"NuGetGallery.PackagesAtomFeed": "Enabled",
"NuGetGallery.PreviewHijack": "Enabled",
"NuGetGallery.GravatarProxy": "Enabled",
"NuGetGallery.GravatarProxyEnSubdomain": "Enabled",
"NuGetGallery.ODataCacheDurations": "Enabled",
"NuGetGallery.ShowEnable2FADialog": "Enabled",
"NuGetGallery.Get2FADismissFeedback": "Disabled",
"NuGetGallery.UsabillaEveryPage": "Enabled"
},
"Flights": {
"NuGetGallery.TyposquattingFlight": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
},
"NuGetGallery.ManageDeprecation": {
"All": false,
"SiteAdmins": true,
"Accounts": [],
"Domains": []
},
"NuGetGallery.SearchSideBySide": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
},
"NuGetGallery.GitHubUsage": {
"All": false,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
},
"NuGetGallery.ABTesting": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
},
"NuGetGallery.ManageDeprecationApi": {
"All": false,
"SiteAdmins": true,
"Accounts": [],
"Domains": []
},
"NuGetGallery.PackageDependents": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
},
"NuGetGallery.EmbeddedIcons": {
"All": true,
"SiteAdmins": false,
"Accounts": [],
"Domains": []
}
}
}
And have no effect. Still have 400 (The
Regarding the 500 you are getting, I didn't manage to reproduce it on my machine. Did you change
Gallery.StorageTypesetting in web.config? What aboutGallery.AzureStorage.*settings?
<!-- These should change on every deployment (to rotate credentials, etc.) -->
<add key="Gallery.StorageType" value="FileSystem" />
<!-- The storage type to use. Can be FileSystem (default) or AzureStorage -->
<add key="Gallery.FileStorageDirectory" value="D:\NugetStorage\Files" />
<!-- The storage path. Default: ~\App_Data\Files -->
<add key="Gallery.AzureStorage.Auditing.ConnectionString" value="" />
<add key="Gallery.AzureStorage.UserCertificates.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Content.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Errors.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Packages.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Statistics.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Uploads.ConnectionString" value="" />
<add key="Gallery.AzureStorage.Revalidation.ConnectionString" value="" />
<!-- The various Azure Storage connection strings to use. If the Gallery.StorageType is AzureStorage, all must be defined. -->
<add key="Gallery.AzureStorageReadAccessGeoRedundant" value="false" />
And to set some expectations: Gallery does not contain code to extract the icon from the package to display it on the package details page, it is done by catalog2dnx job. So, enabling that flight will only make Gallery accept such packages, it will not make it show actual icons that are inside packages.
Yes, thanks. I'm clearly understand it. And "make Gallery accept such packages" is more than enough for us right now.
OK, I had the issue reproduced. Could you please try copying that flags.json to D:\NuGetStorage\Files\Content\flags.json (according to your Gallery.FileStorageDirectory)?
I've created a Symbolic link for Content directory:
New-Item -Path D:\NugetStorage\Files\Content -ItemType SymbolicLink -Value C:\inetpub\NuGetGallery\App_Data\Files\Content
It's works like a charm! /Admin/Features link works now! (no more 500 error)
And pushing packages with <icon> element works too.
Pushing Microsoft.Extensions.Logging.Abstractions.3.1.4.nupkg to 'https://localnuget/api/v2/package'...
PUT https://localnuget/api/v2/package/
Created https://localnuget/api/v2/package/ 4729ms
Your package was pushed.
Thank you for bearing with me =)