Visual Studio for Mac Nuget [英] Visual Studio for Mac Nuget
问题描述
我似乎无法在Visual Studio for Mac中使用Microsoft.EntityFrameworkCore。尽管我付出了很多努力,但该软件包在.csproj中被引用,如下所示。
I cannot seem to use Microsoft.EntityFrameworkCore in Visual Studio for Mac. Despite all of my efforts, The package is referenced in the .csproj as shown below.
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" />
</ItemGroup>
我已经恢复了包裹。
然而当我尝试构建时,以下代码使用System断开
Yet when I try to build, the following code breaks
using System;
using Microsoft.EntitiyFrameworkCore;
namespace Todos
{
public class TodoContext : DBContext
{
public DBSet<Todo> Todos { get; set; }
}
}
EntityFrameworkCore在名称空间中不存在"Microsoft"
EntityFrameworkCore does not exist in the name space "Microsoft"
当然也找不到DBContext和DBSet。
and of course DBContext and DBSet are not found either.
以前有没有人遇到这样的问题?我知道VS for Mac仍在预览中。但如果这确实是VS的一个错误,那么这是一个非常讨厌的错误。
Has anyone experienced issues like this before? I am aware that VS for Mac is still in preview. But if this is really a bug with VS then it's a pretty nasty one.
推荐答案
你好Edwin Jacksonx,
Hi Edwin Jacksonx,
欢迎来到MSDN论坛。
Welcome to the MSDN forum.
>>> EntityFrameworkCore在名称空间中不存在"Microsoft"
>>>EntityFrameworkCore does not exist in the name space "Microsoft"
我注意到使用名称空间拼写错误,应该是Microsoft。实体 FrameworkCore而不是Microsoft。 Entitiy FrameworkCore。所以请尝试将其更改为Microsoft。实体 FrameworkCore,
检查它是否正常工作。
I have noticed that the using name space is misspelled, should be Microsoft.EntityFrameworkCore rather than Microsoft.EntitiyFrameworkCore. So please try to change it to the Microsoft.EntityFrameworkCore, check if it works fine.
>>> 找不到DBContext和DBSet
>>>DBContext and DBSet are not found either
这个问题,您可以按照
此文档。
For this issue, you can follow the step 3 in this documentation.
希望这可以帮助您。
Hope this can help you.
这篇关于Visual Studio for Mac Nuget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!