2

I have an existing project and for the last couple days I have been having major issues with it, major to me because I don't know how to fix them. The one that is frustrating me right now is this error

There was an error running the selected code generator: 'Object reference not set to an instance of an object'

I get this after I add a controller and try to generate a view from the controller. I have checked my entity framework references and everything is the same. I have looked around and have seen other questions about this, some say to reinstall visual studio, others say uninstall and reinstall Entity Framework. I thought about reinstalling Visual Studio but I also tried creating a new MVC project and have no issues at all when adding a controller and then adding a view from the controller.

This project was also bound to TFS, and I renamed the folder and opened the project so I could fix some issues and do some testing with it, so if I create any more issues after fixing the issues that I still had a fresh copy to work with.

EDIT

I took a look at that link and there was nothing in there that I seen that remotely looks like my issue, I even tried creating it as a partial view and same error.

I add a controller to the controller folder, then I right click in the action result and select Add View and this is where the error pops up, I try and create it as a partial view and same error

Chris
  • 2,613
  • 7
  • 34
  • 93
  • 1
    @OndrejTucny, Did you not read the question? that link doesn't help at all. – Chris Oct 18 '15 at 20:30
  • When are you getting this exception, is it while creating the site or running the site? – Sachin Gaikwad Oct 19 '15 at 04:17
  • @SachinGaikwad, neither. You know when you create a controller by right clicking on the Controller folder and you add the controller, then you right click in the Action of the newly created controller and select Add View, it happens right then, when I try to create a view. Its not a new project, its an existing project. – Chris Oct 19 '15 at 12:08
  • I'm facing the exact problem which is caused by the Visual Studio 2015 EF6 code generator as part of the controller generation process. This is not an error which happens due to a bug in code. – Shahal Hazan Jan 10 '16 at 15:36

0 Answers0