none
Visual Studio for Mac Nuget

    Question

  • 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>

    I have restored the packages.

    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 does not exist in the name space "Microsoft"

    and of course DBContext and DBSet are not found either. 

    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.

    Saturday, April 29, 2017 11:48 PM

All replies

  • Hi Edwin Jacksonx,

    Welcome to the MSDN forum.

    >>>EntityFrameworkCore does not exist in the name space "Microsoft"

    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 and DBSet are not found either

    For this issue, you can follow the step 3 in this documentation.

    Hope this can help you.



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 01, 2017 8:12 AM
  • @Edwin, Does the answer resolve your question? If not, could you please let us to know the latest status of this question? We will follow it up.

    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, May 05, 2017 9:24 AM