Fork me on GitHub

logo我的个人地带

努力每一天,每天进步一点点,每天快乐一点点

System.Globalization.CultureNotFoundException

错误信息:

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.”

解决办法:

双击项目,打开

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <!--删除下面这句,或者改为false-->
    <InvariantGlobalization>true</InvariantGlobalization>
    
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Hangfire" Version="1.8.6" />
    <PackageReference Include="Hangfire.Core" Version="1.8.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
  </ItemGroup>

</Project>


Comments 0