4
votes

When I try to add migration I get:

This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See http://go.microsoft.com/fwlink/?LinkId=798221 for details and workarounds.

But in my project.json file I have this:

"frameworks": {
    "net461": {
       "buildOptions": {
          "emitEntryPoint": true
       }
    }
}

What can I do?

Thanks!

3

3 Answers

1
votes

Put in your project.json and create a Program.cs File

"buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
},
0
votes

I had converted my library containing my data models to using the "netcoreapp1.0" framework instead of "netstandard1.5", this includes including the Microsoft.NETCore.App dependency and build options, and requiring the hosting core right now.

I had just run into this (first time tweaking migrations since RC2 conversion) and I'm not finding better options for now. I'll continue digging but if you're stalled this configuration appears to get me back running for now.

0
votes

Finally y put out this:

"frameworks": {
    "net461": {
    }
},
"buildOptions": {
          "emitEntryPoint": true
}