3

I'm leveraging a large existing codebase of business objects and their associated data access layer into an ASP.NET MVC web application. When scaffolding views for the business objects, the scaffolding engine fails with the following message in Visual Studio 2013:

Error

There was an error running the selected code generator:
'The method or operation is not implemented.'

In Visual Studio 2012, the error is:

Error

There was an error running the selected code generator:
'The Extender Provider failed to return an Extender for this object.'

Already tried:

  • Copying the default templates to a CodeTemplates folder: I got custom templates to work just fine on some POCOs I added directly to the project, but they fail on the real objects I want to use.
  • Wrapping the CodeTemplates in try/catch blocks with the catch set to write to trace: I tried this method but never got any trace results. I suspect the error is before the template itself starts processing.

Of note, the business objects are split into three partial classes each. The "Model class" select list in the "Add View" window shows three of each class name, but selecting any of the three for any of the business object classes gives the same error.

How can I find out what is causing the actual error and either correct it or find a workaround?

UtopiaLtd
  • 2,520
  • 1
  • 30
  • 46
  • Are you able to find in the stack trace what method or operation is throwing that VS2013 exception? – krillgar Apr 06 '15 at 14:19
  • No, which is a big part of the problem. All I get are message boxes with the error. Nothing even shows up in the output pane. – UtopiaLtd Apr 06 '15 at 14:20
  • can you share same some of code against which you are using scaffolding. – Jalpesh Vadgama Apr 06 '15 at 14:20
  • That would be difficult since the code is on a closed network--I'm more interested in getting any kind of feedback at all from the scaffolding system to tell me where it's having a problem. – UtopiaLtd Apr 06 '15 at 14:26
  • Have you tried deleting all binaries and obj files within the solution as suggested [here](http://stackoverflow.com/q/3397779/3242721)? – Michal Hosala Apr 07 '15 at 08:21
  • Yes, I have a batch file that deletes out all the bin and obj folders in the solution tree. It did not help, however. – UtopiaLtd Apr 07 '15 at 14:20
  • 1
    I had this same problem when my model inherited a type defined in another assembly. I could use the generator if I specified the external type directly or if I removed the inheritance, but every time I tried to maintain an inheritance relationship between assemblies I got "The method or operation is not implemented" (this in VS 2015). Annoying. – Kris Oye Jun 02 '16 at 23:28

2 Answers2

0

Check what version of EntityFramework are you using, if it is > 6.1.0 turn it to 6.1.0. or lower. I dont know why it is so, but when i changed version of EntityFramework in my project scaffolding starts work correctly.

inatoff
  • 151
  • 2
  • 12
-1

In my experiences, most error is either the code haven't compiled yet (It's kinda a weird issue, VS sometimes can't see the class that is not compiled yet), or perhaps different namespace used,

I hope that's really helps