我开发了一个xamarin.forms应用程序 . 一切都很好,我更新了我的Visual Studio安装 . 但现在我正在低于错误 . 这是代码:
using SQLite;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace SampleApp
{
[SQLite.Table("CSV_File")]
public class FileCSV : INotifyPropertyChanged
{
private int _id;
[ForeignKey("Id")]
[PrimaryKey, AutoIncrement, NotNull]
public int Id
{
get
{
return _id;
}
set
{
this._id = value;
OnPropertyChanged(nameof(Id));
}
}
而且是错误:
错误CS0246找不到类型或命名空间名称'ForeignKey'(您是否缺少using指令或程序集引用?)错误CS0234名称空间'System.ComponentModel'中不存在类型或命名空间名称'DataAnnotations'(你错过了程序集引用吗?)
1 回答
将共享项目的目标配置文件更改为Profile259 .