admin管理员组

文章数量:1643943

sqlsugar 排查方式

https://www.donet5/home/doc?typeid=1218

连接字符串:server=.;uid=sa;pwd=haosql;database=SQLSUGAR4XTEST

如果ORM连接不上数据库:
请使用原生写法测试:new SqlConnection(“字符串”).Open(); 原生写法通过ORM就能用

new SqlConnection(db.CurrentConfig.ConnectionString).Open()//原生进行测试 是否是 SqlSUgar问题
如果是偶发情况:那么就使用SqlSugarScope 单例模式保证线程安全或者排查线程问题

sqlsugar net8 Only the invariant culture is supported in globalization-invariant mode. See https://

{
“code”: 500,
“message”: “程序异常!”,
“data”: "中文提示 : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,错误信息:Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter ‘name’)\r\nen-us is an invalid culture identifier.DbType=“SqlServer”;ConfigId=“1”.\r\nEnglish Message : Connection open error . Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter ‘name’)\r\nen-us is an invalid culture identifier.DbType=“SqlServer”;ConfigId=“1” ",
“success”: false
}

报错显示:这个问题是由于.NET Core应用程序在全球化不变的模式下运行,而该模式只支持不变的文化,而不支持其他任何文化。

解决方法:

    将 <InvariantGlobalization>true</InvariantGlobalization>里面的内容改成false即可。

参考链接
https://blog.csdn/lihuxie/article/details/134795017
https://www.donet5/Ask/9/23402

本文标签: InvariantcultureSqlSugarModeHTTPS