I wonder if template 10 is compatible with netstandard2.0. I have a very simple library listed below:
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
namespace TransactionModel
{
public class MyTransaction
{
[Key]
public Guid TransactionId { get; set; }
public string BankID { get; set; }
public string MerchantID { get; set; }
public DateTime TransactionDate { get; set; }
public string TransactionDescription { get; set; }
public float TransactionAmount { get; set; }
public string TransactionComments { get; set; }
}
public class TransactionContext : DbContext
{
public DbSet<MyTransaction> transactionBatch { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionBuilder)
{
optionBuilder.UseSqlite("Data source=transactions.db");
}
}
}
This library csproj file listed below:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netstandard2.0</TargetFrameworks>
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="microsoft.entityframeworkcore.Sqlite" Version="2.0.1" />
<PackageReference Include="microsoft.entityframeworkcore.tools" Version="2.0.1" />
</ItemGroup>
</Project>
I have installed package Microsoft.EntityFrameworkCore.Sqlite and Microsoft.EntityFrameworkCore.Tools and then add-migration to scaffold the database successfully.
But when I tried to make reference to TransactionModel, the compiler generated a bunch of errors, but I think this is the main error: " Cannot resolve Assembly or Windows Metadata file.."
I have attached a image of my vs2017 solution. I have written no code on T10 yet, I have just created T10 template, made reference to my library and vs2017 has generated the errors. If I use UWP, I did not get such error...
So my question is whether it is possible to use T10 with EntityFrameworkCore and netstandard2.0? Is there a way to go around the error?