遇見一個奇怪的錯誤訊息 – 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
遇見上面的錯誤訊息
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
請點選您的專案檔 .csproj
把底下這一段的 true(預設值)改成 false 即可
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>false</InvariantGlobalization>
<!-- .NET 8.0專用 。原本是 true ,修改為 false 即可 -->
</PropertyGroup>
Youtube影片網址 https://youtu.be/AKyjEO7BAxc