-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in ColorPicker after deploy to IIS #1705
Comments
In my opinion this error is caused by wrong .NET version installed on your IIS server - definitely not related to our component . You need to install .NET 8 Windows Hosting Bundle: |
Thank you for reply mr. enchev. I think that error has something to do with color parsing and localization. I use many radzen components in this poject (menu, grid, editors, dropdowns,..), but only color component show error. |
I have also encountered this problem after deploying the app on IIS (it worked fine on my PC). In this link https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-hybrid-mode.md is mentioned that there is a breaking change with the To solve this i have added these configurations
to my .csproj and now I don't get the exception anymore. Hope this is useful. |
It doesn't work. I get error
System.Globalization.CultureNotFoundException: Only the invariant culture
is supported in globalization-invariant mode. See
https://aka.ms/GlobalizationInvariantMode for more information. (Parameter
'name')
en-us is an invalid culture identifier.
at System.Globalization.CultureInfo.GetCultureInfo(String name)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1
retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides
overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open()
at
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.OpenDbConnection(Boolean
errorsExpected)
at
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean
errorsExpected)
at
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean
errorsExpected)
at
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject
parameterObject)
at
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator
enumerator)
at
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__21_0(DbContext
_, Enumerator enumerator)
at
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState
state, Func`3 operation, Func`3 verifySucceeded)
at
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
V V sre., 30. okt. 2024 ob 12:22 je oseba nick ***@***.***>
napisala:
… I have also encountered this problem after deploying the app on IIS (it
worked fine on my PC).
The problem should be caused in the RGB class, when the dictionary is
called with the StringComparer.InvariantCultureIgnoreCase.
In this link
https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-hybrid-mode.md
is mentioned that there is a breaking change with the GetHashCode method.
To solve this i have added these configurations
<PropertyGroup>
<HybridGlobalization>false</HybridGlobalization>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
to my .csproj and now I don't get the exception anymore.
Hope this is useful.
—
Reply to this email directly, view it on GitHub
<#1705 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJOAT7HVDPQSJ6GSXE756WTZ6C6PDAVCNFSM6AAAAABOSWMEXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGY4TGMZWGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
We will try to not use |
…ultureIgnoreCase)`. Should fix #1705.
Cool, thanks for the heads up!
…On Mon, 4 Nov 2024, 08:18 Atanas Korchev, ***@***.***> wrote:
We will try to not use new Dictionary<string,
string>(StringComparer.InvariantCultureIgnoreCase) with the next release.
Hopefully it fixes the issue.
—
Reply to this email directly, view it on GitHub
<#1705 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJOAT7ARKVOY6IAK4OQK3W3Z64NTLAVCNFSM6AAAAABOSWMEXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTHE3DMOJYHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm running 5.6.15 and I have the error PlatformNotSupported_HybridGlobalization System.TypeInitializationException: TypeInitialization_Type, Radzen.Blazor.Rendering.RGB |
We've been banging our head against this one and can't seem to figure out a fix. Adding the following lines may have fixed that issue, but it caused our dollar signs '$' to be replaced with '¤' everywhere we use ".ToString("c")".
|
Please tell us how to reproduce the issue so we can fix it once and for all. What kind of app do you have (server, wasm, auto rendering, wasm standalone)? Which .NET version? |
I am working on the same project that SOSHsbaker is: To reproduce you have to create a project with both a color picker and a html field that displays a formatted currency string using ".ToString("C")" then add
Color picker will throw an error unless InvariantGlobalization is true but that then turns the currency symbol in the formatted string into a default currency symbol instead of one that relates to our location. App Type: Server |
I think the currency formatting is expected to be a square with invariant culture. This is beyond our control. Please tell me how to reproduce the ColorPicker exception. |
I created a test Blazor Server app which targets .NET 8.x and I can't reproduce this problem. Here is the test app. |
The issue seems to be occuring upon converting hex codes to RGB and vice versa using "Radzen.Blazor.Rendering.RGB.Parse(Value).ToCSS();" We made a project and used HTML 5 color picker instead but still used those functions and the issue still remained. |
Guys, we can't fix the problem unless we reproduce it. Please check the attached project and tell me what to do so the exception happens. |
The bug occurs on published versions only, so it is not repeatable on debugging. We found a solution to this issue by downgrading our visual studio from 17.12.x to 17.10.9 LTS, sorry for all the confusion |
I also tested with a published version |
There is nothing special. I use RadzenColorPicker in a way
<RadzenColorPicker Name="Color" class="w-100" @bind-Value="_StallCode.Color" />
Everything works in debug. But after I deploy my project to IIS, I get flowing error.
System.TypeInitializationException: TypeInitialization_Type, Radzen.Blazor.Rendering.RGB ---> System.PlatformNotSupportedException: PlatformNotSupported_HybridGlobalization, HashCode at System.Globalization.CompareInfo.GetHashCodeOfStringCore(ReadOnlySpan
1 , CompareOptions )at System.Globalization.CompareInfo.GetHashCode(ReadOnlySpan
1 , CompareOptions ) at System.Globalization.CompareInfo.GetHashCode(String , CompareOptions ) at System.CultureAwareComparer.GetHashCode(String ) at System.Collections.Generic.Dictionary
2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryInsert(String , String , InsertionBehavior )at System.Collections.Generic.Dictionary
2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].set_Item(String , String ) at Radzen.Blazor.Rendering.RGB..cctor() Exception_EndOfInnerExceptionStack at Radzen.Blazor.RadzenColorPicker.SetInitialValue() at Radzen.Blazor.RadzenColorPicker.OnInitialized() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Radzen.RadzenComponent.SetParametersAsync(ParameterView parameters) at Radzen.Blazor.RadzenColorPicker.SetParametersAsync(ParameterView parameters)
The text was updated successfully, but these errors were encountered: