从NuGet安装System.Data.SqlClient时出错

编程入门 行业动态 更新时间:2024-10-11 19:19:10
本文介绍了从NuGet安装System.Data.SqlClient时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

好的,我正在Unity中制作一个访问A MySql数据库中数据的游戏。我从Visual Studio 2017安装程序安装了数据处理包,并添加了对System< g class =" gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep"的引用。数据-GR-ID =" 14'; ID = QUOT; 14';>。数据< / g取代;在我的解决方案然而,当我尝试从NuGet安装System.Data.SqlClient时,我从包管理器获得此输出:

尝试 以收集相关性信息 for package 'System.Data.SqlClient.4.5.1' with 对项目的尊重 'Assembly-CSharp' , targeting '。NETFramework,Version = v3.5' Gathering 依赖信息 382.04 msAttempting to resolve dependencies for package 'System.Data.SqlClient.4.5.1' with DependencyBehavior 'Lowest' Resolving 依赖信息 0 msResolving要安装的操作 package 'System.Data.SqlClient.4.5.1' 已解决 要安装的操作 package 'System.Data.SqlClient.4.5.1' 检索 package 'System.Data.SqlClient 4.5.1' from 'nuget' 。 安装 failed 。 滚动 back ... Package 'System.Data.SqlClient.4.5.1' not 存在 in project 'Assembly-CSharp' Package 'System.Data.SqlClient.4.5.1' not 存在 in 文件夹 'C:\Users\kids only\Desktop\Unity Projects\Cool YT RPG \packages' 执行 nuget actions taking 5.54 secCould not install package 'System.Data.SqlClient 4.5.1' 。 你 正在尝试安装 this package into 一个目标项目 '。NETFramework,Version = v3.5' , 但是 package not 包含任何程序集引用 或 兼容的内容文件 with 那个框架 。 对于 更多信息 , 联系 package 作者 。 时间 Elapsed : 00 : 00 : 06.1397891 ========== 已完成 ==========

请,我是Visual Studio,Unity,C#的新手,  ;请提供详细,易于理解,逐步说明如何解决此问题的说明。

解决方案

尝试更改"项目属性"窗口中的"目标框架"版本。选择4.5.1或更新版本。

对于MySql,您可能需要另一个包。

Okay, so I am making a game in Unity that accesses data from A MySql Database. I installed the Data processing package from the Visual Studio 2017 Installer and I added a reference to System<g class="gr_ gr_14 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="14" id="14">.Data</g> in my solution. Yet, when I try installing System.Data.SqlClient from NuGet, I get this output from Package Manager:

Attempting to gather dependency information for package 'System.Data.SqlClient.4.5.1' with respect to project 'Assembly-CSharp', targeting '.NETFramework,Version=v3.5'Gathering dependency information took 382.04 msAttempting to resolve dependencies for package 'System.Data.SqlClient.4.5.1' with DependencyBehavior 'Lowest'Resolving dependency information took 0 msResolving actions to install package 'System.Data.SqlClient.4.5.1'Resolved actions to install package 'System.Data.SqlClient.4.5.1'Retrieving package 'System.Data.SqlClient 4.5.1' from 'nuget'.Install failed. Rolling back...Package 'System.Data.SqlClient.4.5.1' does not exist in project 'Assembly-CSharp'Package 'System.Data.SqlClient.4.5.1' does not exist in folder 'C:\Users\kids only\Desktop\Unity Projects\Cool YT RPG\packages'Executing nuget actions took 5.54 secCould not install package 'System.Data.SqlClient 4.5.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.Time Elapsed: 00:00:06.1397891========== Finished ==========

Please, I'm new to Visual Studio, Unity, C#,ect. please give detailed, easy-to-understand, step-by-step instructions on how to fix this problem.

解决方案

Try changing the Target Framework version in Project Properties window. Select 4.5.1 or newer.

For MySql, you probably need another package.

更多推荐

从NuGet安装System.Data.SqlClient时出错

本文发布于:2023-11-11 08:15:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577853.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:System   NuGet   SqlClient   Data

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!