Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

[Error running the selected code generator] with EF 6 and MVC5 project --

$
0
0

Hey there.

Apologies in advance if the question appears too trivial. I am on VS 2017, updated to latest SDKs and runtime.

I created a .NET MVC5 project. Added a DB called BookDB.mdf in my App_Data. Contains just 1 table called Books. Generated an . edmx model and added it to my project as Book.edmx.
Now, when I am trying to scaffold a new MVC5 controller with Views and with EF, I am getting the following error, pls refer to the attached image -- [https://ibb.co/z8Ddt9Z]

While generating the scaffold I tried both options as model class for the view -
* the book class available with the edmx entitiy
* a book model class that I wrote separately for this purpose only, to match with the schema of the table.

Here's the book model class -

public class Book
    {
        [Key]
        public int Id { get; set; }

        public string book_name { get; set; }
        
        public string book_author { get; set; }

        public int book_pages { get; set; }
    }

What does it point to? Anything to do with the version of VS I am using? What is the problem? Let me furnish some more pertinent information.

My MVC5 project is targeting FmWk 4.5. My EF version I used to create the edmx model is 6.0.
I searched for a couple of links on this scenario StackOverflow and tried out the solutions [neither were marked as answers though I agree]. But as expected, No.



Please offer some insight and trouble shooting.

Thanks.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>