0

I am trying to enable migrations in my project with postgresql but I am encountering this error when I run Enable-Migrations in the package manager console. I have already tried uninstalling and re-installing entity framework.

Enable-Migrations : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:1
+ Enable-Migrations
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Enable-Migrations], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Enable-Migrations

The DbContext :

using System.Data.Entity;

namespace HalfPugg.Models
{
    public class HalfPuggContext : DbContext
    {
        public HalfPuggContext() : base("Half-Pugg")
        {

        }

        public DbSet<Gamer> Gamers { get; set; }

        public DbSet<Game> Games { get; set; }

        public DbSet<Classification_Gamer> Classification_Gamers { get; set; }

        public DbSet<Match> Matches { get; set; }

        public DbSet<Classification_Game> Classification_Games { get; set; }

        public DbSet<Classification_Match> Classification_Matchs { get; set; }

        public DbSet<Filter> Filters { get; set; }

        public DbSet<Group> Groups { get; set; }

        public DbSet<Hall> Halls { get; set; }

        public DbSet<HashTag> HashTags { get; set; }

        public DbSet<Label> Labels { get; set; }

        public DbSet<MessageGamer> MessageGamers { get; set; }

        public DbSet<MessageGroup> MessageGroups { get; set; }

        public DbSet<MessageHall> MessageHalls { get; set; }

        public DbSet<Numbered> Numbereds { get; set; }

        public DbSet<Range> Ranges { get; set; }

        public DbSet<RequestedGroup> RequestedGroups { get; set; }

        public DbSet<RequestedHall> RequestedHalls { get; set; }

        public DbSet<RequestedMatch> RequestedMatchs { get; set; }

        public DbSet<Template> Templates { get; set; }

    }
}

Maíra Matos
  • 23
  • 1
  • 5
  • 1
    I think this is has to do with your dbcontext class constructor. Could you please share your dbContext class? – Moe Jallaq Oct 13 '19 at 15:56
  • It looks good which weird! I'm not sure what version of EF do you have installed but if you have 6.3 I think it has something wrong based on what I've read before. Some devs recommend downgrading to 6.2.0 based and others had it to work by uninstalling and re-installing. You can find more in the below links: [First Link](https://entityframework.net/knowledge-base/14410987/entity-framework-code-first-migration-error) [Second Link](https://stackoverflow.com/questions/14410987/entity-framework-code-first-migration-error) Let me know what will you get – Moe Jallaq Oct 13 '19 at 21:08
  • Thank you, now I'm using Entity Framework 6.2.0 and EntityFramework6.Npgsql 3.2.1.1 – Maíra Matos Oct 14 '19 at 11:16

0 Answers0