ASP.NET MVC Core/6: EF 6 scaffolding error

asp.net-core-mvc c# entity-framework-6

Question

I utilizeEF 6 with MVC Core/6. I use DI to inject the database context into the controllers even if my models and database context are in separate projects. But if I use scaffolding to connect the controller,EF 6 I'm getting the following error as the data context class:

Error

There was an error running the selected code generator: 'A type with the name MyProject.DAL.ModeIs.MyModel does not exist Microsoft.VisuaIStudio.Web.CodeGeneration.ActionInvokerb__6_0() Microsoft. Extensions.CommandLineUtiIs.CommandLineAppIication.Exe cute(String[] args) Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execu te(String[] args)'

1
1
6/9/2016 11:29:58 AM

Popular Answer

The first release, RC2, allows you to use non-ASP.NET Core projects in your solution to a certain extent. I've discovered from experience that it only functions if both projects were made using Visual Studio 2015 Update 2 and.NET Framework 4.6.1.

There has been a problem on GitHub about this for a while. I struggled with the solutions offered in that topic and gave up after running into problems. So I made the decision to hold off until a usable release was available. I included an ASP.NET Core (.NET Framework) project with all of my common code. I created an empty project, deleted everything but project.json, and made it look like a class library project. Then I add a WebAPI 2 method that I can access from my RC2 app for any functionality that is not provided by that stack.

2
6/9/2016 12:26:30 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow