Entity Framework: ERROR: Die Konfiguration aus der Datei [...]/AppSettings.json nicht geladen hat; Es kann keinen 'DBConC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Entity Framework: ERROR: Die Konfiguration aus der Datei [...]/AppSettings.json nicht geladen hat; Es kann keinen 'DBCon

Post by Anonymous »

Ich bin auf den folgenden Fehler gestoßen: < /p>

Code: Select all

Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[FourGameApp.Data.DataContext]' while attempting to activate 'FourGameApp.Data.DataContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
Beim Versuch, einen Befehlsdotnet -EF -Migrationen auszuführen, fügen Sie initial .

Code: Select all

using FourGameApp.Entities;
using Microsoft.EntityFrameworkCore;

namespace FourGameApp.Data
{
public class DataContext : DbContext
{
public DataContext(DbContextOptions options) : base(options) { }
public DbSet Games { get; set; }
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post