从NuGet安装System.Data.SqlClient时出错 [英] Error With Installing System.Data.SqlClient From NuGet

查看:559
本文介绍了从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.org'  安装  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.org'.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时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆