Skip to content

Use start-up project for ConfigureServices #2219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moozzyk opened this issue May 17, 2015 · 1 comment
Closed

Use start-up project for ConfigureServices #2219

moozzyk opened this issue May 17, 2015 · 1 comment
Assignees
Milestone

Comments

@moozzyk
Copy link

moozzyk commented May 17, 2015

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

@bricelam
Copy link
Contributor

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

@rowanmiller rowanmiller changed the title NRE when trying to add a migration Use start-up project for ConfigureServices May 18, 2015
@rowanmiller rowanmiller added this to the 7.0.0 milestone May 18, 2015
@bricelam bricelam modified the milestones: 7.0.0-beta6, 7.0.0 May 29, 2015
@ajcvickers ajcvickers modified the milestones: 1.0.0-beta6, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants