12

Upgraded to Dotnet Core 3.1 from 2.2, EF core kept complaining EF1001: internal ef core api usage by putting an Exclamation Mark in my project.

But no error / warning shown during compilation. I do not know which line of code is causing the trouble.

May I know how can I find out which API / Method that I am not suppose to use?

s k
  • 4,342
  • 3
  • 42
  • 61
  • what do you mean about `putting an Exclamation Mark in my project.` ? do you have any runtime error? are you using `app.UseDeveloperExceptionPage ();` middleware? – AliReza Sabouri Feb 15 '20 at 03:27
  • Alireza, In my solution explorer, I saw an Exclamation Mark next to **Dependencies**. Nope, there isn't any runtime error, everything works as normal. This is regarding EntityFramework, not ASPNET – s k Feb 15 '20 at 05:46

3 Answers3

6

The warnings from these analyzers can be really confusing. If I understand this correctly, the issue is not what it seems.

The message with the gray warning icon inside the analyzer is normal and indicates what the analyzer is checking. See the Analyzers in Solution Explorer documentation for an explanation.

Analyzer diagnostics

If you are experiencing yellow icons on the parent node ("Analyzers") try to unload/reload the project, or maybe open Visual Studio in admin mode. See the answer to "Analyzers warnings in ASP.NET Core 2.2 project in VS2019 " for details.

If you don't see a warning in the error list then I advise you to ignore that.

The GitHub issue "Confusing analyzer warnings in solution explorer with no way to see any details" provides additional information on this.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Rafiki
  • 61
  • 1
1

Are you using a database provider (i.e. packages for SQLServer, Postgres, etc)?

It sounds like you are saying there is some warning being given with your dependencies. I know Microsoft announced some breaking changes, mainly for database providers, with EF Core with the 3.0+ updates. Could be as simple as updating the other packages in your project.

Just guessing, I could very well be wrong.

Pang
  • 9,564
  • 146
  • 81
  • 122
jdewerth
  • 564
  • 3
  • 9
  • 2
    Yes, I think you are correct. The exclamation mark is gone today, and no warning during compilation. But when I click and look into the Dependencies, the EF1001 is still there. All the items inside Dependencies are re-arranged. I think MS is still working on this. Maybe I just ignore it for now. – s k Feb 16 '20 at 06:46
0

figure it out for me, was getting the same warning,

it was using an entity framework namespace

(using Microsoft.EntityFrameworkCore.Internal;) and not

using System.Linq; which was extremely odd as I didn't add the Ef one at all.

which is why I was so confused and started googling and how i got to this page.

Seabizkit
  • 2,417
  • 2
  • 15
  • 32