-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Multiple projects and migrations #43
Comments
dupe of dotnet/efcore#2679 ? |
Yeah, I saw that one, but I wasn't sure if that was exactly the case, even if it's similar. My first instinct is to just create a symlink to Startup.cs from the data access project to the project main, but that's just a hack. Instead, I began looking at the EF code, but then I wondered why it got ugly when @bricelam looked at, but then I realized I didn't understand nearly enough to even properly evaluate "ugly" so I stopped. So thinking out loud here, if dnu/dnx knows that there is another project because it's listed in the dependencies, couldn't EF ask dnu/dnx about that? Or does dnu/dnx just keep that information to itself? Anyway, I love this stuff! |
The Startup could not be found error should be resolved (in the nightly builds) by dotnet/efcore#3327. We need dotnet/efcore#2679 to fully enable the scenario, and when it's in the commands would look something like this. cd src\Business
dnx ef migrations add MyMigration --startupProject MyWebApplication |
We should have some documentation about how to get EF to work when start-up and context are in different projects.
|
Consolidating with #204 |
I seem to be in a bit of circular issue: I have a Web and a Business project. All my db access is in Business, and so when I'm in my Business directory, and run the command dnx ef migrations add FirstMigration, I get error messages complaining that "A type named 'StartupProduction' or 'Startup' could not be found in assembly Business" - but Startup wouldn't be here, it would be in the other directory/project. But if I do go into my Web project directory, I get different errors about there being no DbContext...
So is that right? Do I need a Startup.cs in my Business project? Or is there some kind of service I need to add (and more than a using statement that points to my Business project, since I have that) to the Startup.cs file?
PS Need to transfer this to the EF area, as it isn't really a documentation issue I have...
The text was updated successfully, but these errors were encountered: