无法在Visual Studio Xamarin项目中插入System.data.sqlClient [英] Cannot instell System.data.sqlClient in Visual Studio Xamarin project

查看:332
本文介绍了无法在Visual Studio Xamarin项目中插入System.data.sqlClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前曾问过一个关于Azure数据库的问题,并给出了一个有用的解决方案,但是要使用该解决方案,我需要安装System.Data.SqlClient。我尝试从Microsoft安装NuGet软件包,但是每当执行此操作时,都会出现以下错误。非常感谢您的帮助。该项目是使用xamarin.forms和可移植类库的跨平台应用程序。我正在尝试将其安装到Appname(便携式),因为这是我的脚本所在的位置。谢谢。

I previously asked a question concerning azure databases and was given a helpful solution, however to utilise that solution, I needed to install System.Data.SqlClient. I tried installing the NuGet package from microsoft but whenever I do, I get the following error. I'd really appreciate some help with this. The project is a cross-platform application using xamarin.forms and a portable class library. I'm trying to install it to Appname(portable) because that's where my scripts are. thank you.

Severity    Code    Description Project File    Line    Suppression State
Error       Could not install package 'System.Data.SqlClient 4.3.0'. 
You are trying to install this package into a project that targets '.NETPortable,
Version=v4.5,Profile=Profile259', 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.         0   


推荐答案

来自
配置文件适用于.NET Framework 4.5,Windows 8.0,Windows Phone 8.1,Windows Phone Silverlight 8.0。

From http://portablelibraryprofiles.stephencleary.com/ , profile259 doesn't support system.data.sqlclient. It has windows phone in it.
Profile is for .NET Framework 4.5, Windows 8.0, Windows Phone 8.1, Windows Phone Silverlight 8.0.

更大图片是Xamarin,移动客户端没有直接打sql server的方法。使用webapi等建立服务外观。....请参阅 https: //blog.xamarin.com/developing-enterprise-apps-using-xamarin-forms 以获得一些想法。

Bigger picture is Xamarin and Mobile clients don't have a way to hit sql server directly. Build a service façade using webapi or such..... See https://blog.xamarin.com/developing-enterprise-apps-using-xamarin-forms for some ideas.

这篇关于无法在Visual Studio Xamarin项目中插入System.data.sqlClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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