Windows phone 8.1 can't reference System.Data

旧城冷巷雨未停 提交于 2019-12-17 21:33:13

问题


I'm trying to create a windows phone 8.1 apllication which has access to a local Database. I want to handle the DB acess in a portable class library. For introduction I looked as this webpage: https://msdn.microsoft.com/de-de/library/windows/apps/hh202876(v=vs.105).aspx

But I can't even reference the required namespaces:

using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.ComponentModel;
using System.Collections.ObjectModel;

And also I can't add none of them as reference. Can someone tell me whats wrong


回答1:


You can not use SqlClient in PCL projects because it is not built as a PCL and it is not cross platform. The Data namespace is unavailable in PCL projects and it is not listed here.

The following assemblies are available within a Portable Class Library project:

  • mscorlib.dll
  • System.dll
  • System.Core.dll
  • System.Xml.dll
  • System.ComponentModel.Composition.dll
  • System.Net.dll
  • System.Runtime.Serialization.dll
  • System.ServiceModel.dll
  • System.Xml.Serialization.dll
  • System.Windows.dll (from Silverlight)


来源:https://stackoverflow.com/questions/34674042/windows-phone-8-1-cant-reference-system-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!