Skip to content

Use start-up project for ConfigureServices  #2219

Closed

Description

@moozzyk

I am trying to set up a project where the business logic (including data model) is separated from UI/web. The context has only a ctor that takes only DbContextOptions because I want to use InMemoryStore for tests and SqlServer when actually running the app. I am trying to add a migration from the "engine" project and provide the web project as the start up project since this is where I configure EF to use SqlServer (in the ConfigureServices method). This is on Beta4 bits.

dnx . ef migration add initial -s StarTrader

Information: [LoaderContainer]: Load name=EntityFramework.Relational
Information: [NuGetAssemblyLoader]: Loaded name=EntityFramework.Relational in 3ms
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Data.Entity.Commands.Program.GetProjectPath(String projectName)
   at Microsoft.Data.Entity.Commands.Program.ExecuteInDirectory(String startupProject, Func`1 invoke)
   at Microsoft.Data.Entity.Commands.Program.AddMigration(String name, String context, String startupProject)
   at Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass7_1.<Main>b__6()
   at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.Data.Entity.Commands.Program.Main(String[] args)

There is a recent change that touched this code so it might be already fixed in beta5

Activity

  1. bricelam commented on May 18, 2015

    @bricelam
    Contributor

    The start-up project still isn't used for ConfigureServices. This work is part of #639

  2. changed the title [-]NRE when trying to add a migration[/-] [+]Use start-up project for ConfigureServices [/+] on May 18, 2015
  3. added this to the 7.0.0 milestone on May 18, 2015
  4. modified the milestones: , 7.0.0 on May 29, 2015
  5. modified the milestones: , 1.0.0 on Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions