c# - 对类型 system.icloneable' 的引用声称它在 system.runtime 中定义但无法找到
问题描述
我在“新 SqlConnection”行上收到此错误。
.netcore 2 Web 应用程序 这是包含在具有 nuget 包的 .netstandard 类库中的代码:
系统运行时 4.3.1
系统配置
我真的不知道这里有什么问题,这是我的第一个 .netcore 应用程序,所以我可能在这里缺少一些业余爱好者
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using EP.Data.Helper;
public class BaseDALayer
{
private void ExecuteStoredProcedure()
{
try
{
string connectionString = ConfigurationHelper.GetConnectionString();
using (var connection = new SqlConnection(connectionString))
{
}
}
catch (Exception ex)
{
LogException(ex);
}
}
private void LogException(Exception ex)
{
}
}
解决方案
将 MySql.Data nuget 包更新到最新版本(在我的情况下为 v8.0.23)解决了该问题
推荐阅读
- python - 当有人使用某个命令时,试图让机器人 DM 我
- strapi - Strapi Admin 中的错误 - 发生错误
- react-native - 组通知反应原生
- python - 如何从python中的字典列表中删除重复项
- javascript - 有没有办法通过反应导航有条件地处理单独的 js 文件中的 const?
- java - 如何在程序自行退出之前进行 3 次登录尝试?
- ruby-on-rails - 如果同时使用新的 Rails 应用程序作为 API 和经典的 MVP 应用程序,那么 DRY 令牌身份验证和 API 版本控制是如何完成的?
- java - ParallelStream 上的 CompletableFuture 被批处理并且运行速度比顺序流慢?
- caching - 当 Redia 没有缓存昂贵的数据库查询时,如何缓解这种情况?
- google-apps-script - 相同的日期值,但电子表格公式表明使用“.copyTo”和“.setValue”时它们是不同的值