Microsoft.icu.icu4c.runtime fails in latest version
Hi.
After self-install on azure of umbraco cms updated to latest release, I see the microsoft.icu.icu4c.runtime is version 68.xx and nuget says the latest stable version is 72.xx.
But when I update the icu it makes the install fail. It can't even load. I think there is a bug and it happens in this umbraco code section:
private static nint LoadLibrary(string library, bool failOnLoadFailure)
{
if (!NativeLibrary.TryLoad(library, typeof(object).Assembly, DllImportSearchPath.ApplicationDirectory | DllImportSearchPath.System32, out var handle) && failOnLoadFailure)
{
Environment.FailFast("Failed to load app-local ICU: " + library);
}
return handle;
}.
Error message in debug mode is this:
System.ExecutionEngineException
HResult=0x80131506
Message=Exception of type 'System.ExecutionEngineException' was thrown.
Please investigate - best regards Lars
Yes, I have of course done so. But it can lead to others - as me - that spend a lot of time on finding the course. It would be nice to always be compatible with the latest nuget packages. This error has been here for a while in many releases, so I hope by raising it, it can be solved..
a quick search on the forums would have found you the answer :).
Updating nuget packages is not always the best thing to do regardless of whether it is Umbraco or not.
If you see it as an issue then I would suggest raising it on GitHub rather than on the forums which are just a community based help forum.
I have had this issue before, for me the fix was looking in your csproj, it should have some reference to ICU.68xxxx. Replace that with the version number you updated to and it should work fine.
If you update Microsoft.ICU.ICU4C.Runtime using NuGet you will manually need to edit the RuntimeHostConfigurationOption inside your csproj to match the version number.
A better method is to manually edit your csproj and replace both the PackageReference and RuntimeHostConfigurationOption as below. Then you will be up to date.
<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>
Microsoft.icu.icu4c.runtime fails in latest version
Hi. After self-install on azure of umbraco cms updated to latest release, I see the microsoft.icu.icu4c.runtime is version 68.xx and nuget says the latest stable version is 72.xx. But when I update the icu it makes the install fail. It can't even load. I think there is a bug and it happens in this umbraco code section: private static nint LoadLibrary(string library, bool failOnLoadFailure) { if (!NativeLibrary.TryLoad(library, typeof(object).Assembly, DllImportSearchPath.ApplicationDirectory | DllImportSearchPath.System32, out var handle) && failOnLoadFailure) { Environment.FailFast("Failed to load app-local ICU: " + library); } return handle; }. Error message in debug mode is this: System.ExecutionEngineException HResult=0x80131506 Message=Exception of type 'System.ExecutionEngineException' was thrown. Please investigate - best regards Lars
you shouldn't update it, roll it back to it's previous version.
Yes, I have of course done so. But it can lead to others - as me - that spend a lot of time on finding the course. It would be nice to always be compatible with the latest nuget packages. This error has been here for a while in many releases, so I hope by raising it, it can be solved..
a quick search on the forums would have found you the answer :). Updating nuget packages is not always the best thing to do regardless of whether it is Umbraco or not.
If you see it as an issue then I would suggest raising it on GitHub rather than on the forums which are just a community based help forum.
Sorry - my bad. This is my first post here and I didn't know it was limited to non-umbraco employees..
I have had this issue before, for me the fix was looking in your csproj, it should have some reference to ICU.68xxxx. Replace that with the version number you updated to and it should work fine.
If you update Microsoft.ICU.ICU4C.Runtime using NuGet you will manually need to edit the RuntimeHostConfigurationOption inside your csproj to match the version number.
A better method is to manually edit your csproj and replace both the PackageReference and RuntimeHostConfigurationOption as below. Then you will be up to date.
Great tip, thanks for the info
Thanks @ Jeavon Leopold, you are right, updating the version on system.globalization.appLocalIcu makes the error go away 😀
is working on a reply...