© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
129 replies
Ares

how can i fix this error?

hey so I have a asp.net core mvc app and for some reason suddenly it doesnt want to run anymore. it builds just fine but when i try to run it i get:

MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping Microsoft.EntityFrameworkCore.Storage.TypeMappingSourceBase.FindMapping(System.Type, Microsoft.EntityFrameworkCore.Metadata.IModel)'.
MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping Microsoft.EntityFrameworkCore.Storage.TypeMappingSourceBase.FindMapping(System.Type, Microsoft.EntityFrameworkCore.Metadata.IModel)'.


It says that it happens in my DbContext:


using Microsoft.EntityFrameworkCore;

namespace realTimePolls.Models
{
    public class RealTimePollsContext : DbContext
    {
        public RealTimePollsContext(DbContextOptions<RealTimePollsContext> options)
            **: base(options) { }** <-- Error is here

        public DbSet<Poll> Polls { get; set; }
        public DbSet<User> User { get; set; }

        public DbSet<UserPoll> UserPoll { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Poll>().ToTable("poll"); // Maps the Poll entity to the "poll" table
            modelBuilder.Entity<User>().ToTable("user"); // Maps the User entity to the "user" table
            modelBuilder.Entity<UserPoll>().ToTable("userpoll"); // Maps the User entity to the "user" table
        }
    }
}
using Microsoft.EntityFrameworkCore;

namespace realTimePolls.Models
{
    public class RealTimePollsContext : DbContext
    {
        public RealTimePollsContext(DbContextOptions<RealTimePollsContext> options)
            **: base(options) { }** <-- Error is here

        public DbSet<Poll> Polls { get; set; }
        public DbSet<User> User { get; set; }

        public DbSet<UserPoll> UserPoll { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Poll>().ToTable("poll"); // Maps the Poll entity to the "poll" table
            modelBuilder.Entity<User>().ToTable("user"); // Maps the User entity to the "user" table
            modelBuilder.Entity<UserPoll>().ToTable("userpoll"); // Maps the User entity to the "user" table
        }
    }
}


I dont get why its not working, ive tried:

Completely changing my project structure

Deleting solution file and making a new one

Cleaning solution

Rebuilding

Reinstalling all packages

nothing seems to fix it. any advice? here is my repo: https://github.com/ForkEyeee/realtime-poll
7t348xvgz3gc1.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

How can i fix this error code?
C#CC# / help
3y ago
✅ How can i fix this?
C#CC# / help
6mo ago
✅ How can i fix this?
C#CC# / help
3y ago
❔ how can I fix this?
C#CC# / help
3y ago