You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whatever approach we make, ideally we would be backward compatible and not break old plugins and old scenarios.
Because NuGet and the plugin don't really do anything fancy with localization other than the language displayed and the invariant culture default will be English, we can specify EN-us if the culture is invariant.
The advantage of this is that it's simple, and should have minimal repercussions. The disadvantage is that it's incomplete.
rrelyea
changed the title
Executing plugins with invariant culture
Support executing plugins with invariant culture (as happens in docker)
Nov 20, 2018
Create a basic repro image such as https://github.com/nkolev92/docker-images/blob/4501913d62526441e8bca40b9d01ba96821082aa/dotnetapp/Dockerfile.
When a restore is run with the plugin configured, the plugin exits after the handshake.
The reason why the plugin is terminated is a client side exception caused by https://github.com/NuGet/NuGet.Client/blob/62916a48fe61fc7d94c2f436c7d4569878705dd4/src/NuGet.Core/NuGet.Protocol/Plugins/PluginManager.cs#L358
thrown in https://github.com/NuGet/NuGet.Client/blob/62916a48fe61fc7d94c2f436c7d4569878705dd4/src/NuGet.Core/NuGet.Protocol/Plugins/Messages/InitializeRequest.cs.
The root cause of this is that the default culture for the dotnet docker images is invariant.
An invariant culture has a name that's an empty string, thus causing the above mentioned code to throw.
Docs https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=netframework-4.7.2#culture-names-and-identifiers and https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=netframework-4.7.2#invariant-neutral-and-specific-cultures.
The code as currently written simply cannot handle an invariant culture.
//cc @rrelyea @dtivel
The text was updated successfully, but these errors were encountered: