Skip to content
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

Required Workaround when DbContent is in satellite DLL. #451

Closed
ghost opened this issue Aug 10, 2020 · 2 comments
Closed

Required Workaround when DbContent is in satellite DLL. #451

ghost opened this issue Aug 10, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 10, 2020

Hi @ErikEJ

We have had quite the discussion here
EF Getting Started Discussion trying to figure out why the EF Core Power Tools works on some projects but not others.

Turns out, when the DbContext is in a satellite assembly instead of the start-up project when the project is built, the EF Core NuGet package DLL's are not being copied to the output directory and users are getting the below error in the output window when using your cool extension.

> Build started at 6:12 PM and took 0.680 seconds

System.Exception: Unable to find Microsoft.EntityFrameworkCore.dll in folder C:\Users\saved\Downloads\SamuraiApp-master\SamuraiApp-master\SamuraiApp.Data\bin\Debug\netcoreapp3.1.

You "could" change your code to find the start-up project to locate the EF Core DLLs' to prevent this error.

I came up with this to unblock all the developers who have their DbContext in a satellite assembly.

Essentially, the developer adds an internal class that derives from the DbContent in the other assembly. See below Db class.

They then run the EF Core Power Tools against the start-up assembly, and it works perfectly.

Best regards,

Karl

namespace MainApp {
    class Program {
        static void Main(string[] args) {
             Console.WriteLine("Hello World!");
        }
    }

    class Db : SamuraiDbContext {
    }
}
@ErikEJ
Copy link
Owner

ErikEJ commented Aug 11, 2020

@julielerman
Copy link

Note for you Karl: the reason this particular problem was occurring was because of a bug that was accidentally introduced in early August. It's been fixed with the Sept 18 update of the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants