Code Optimization

Interesting things in software development and code optimization

There was an error running the selected code generator

Hi friends,

there is good article about OAuth/OWIN and MVC 5 that I did read to get an idea what this all is and how to work with that. But after I created a project and went through all steps in the article I had decided to add my own tables and controllers and I did face with the following problem:

so right after I did click the add button to add my controller and to extend the ApplicationDbContext with my models I did get this error again and again.

I did try all steps that I found through the internet but non of them did help me to solve this problem. After a few hours I spent on it I had come to the following solution:

- Open your working project folder.
- Delete the BIN folder
- Delete OBJ folder
- Clean Solution, Rebuild Solution and try to Add Controller

But if you will get another error, like I got, about something like " the AppData\Temp\xxxxx.dll can not be accessed because of it is used by another process" - you will have to stop your antivirus and in my case it was free Panda Antivirus.

Now everything should work and you don't need to change from System.Data.Entity.DbSet<> to System.Data.Entity.IDbSet<>

or whatever in your code.

Thank you :)