Error on executing T4 scaffolfing from EF6 model to views/controller in MVC 6 / DNX project (.xproj)

220 Views Asked by At

There is of course no such option as using customizable scaffolding from EF6 model to views/controller in DNX project's in newest MVC 6. But I've tried to use the PM console command Scaffold (aka Invoke-Scaffolder, from T4Scaffolding.Core.1.0.0\tools\T4Scaffolding.dll ) to investigate what custom codegeneration could migrate and what could not.

Scaffold -Scaffolder Controller -Project DemoDnxMvcApp -OverrideTemplateFolders "D:\cot\klik\kk\vse\V1.DnxMvcApp\" -Force Templates

and get an error 'project DemoDnxMvcApp not found'. It seems t4 scaffolder doesn't understand xproj projects, can't process them.

But also I've noticed there is now possibility to create and execute t4 template inside a such project (e.g that could generate TypeScript from EF6 model).

  • How I could make T4 EF6 scaffolding working with xproj projects?
  • How I could make even simple T4 template working in DNX project ?
  • What tool could replace it in DNX projects if T4 is not supported any more (not enough 'crossplatform')?

P.S. (beta5 DNX used)

2

There are 2 best solutions below

4
Frank On BEST ANSWER

So T4 support in the latest .net is going to be there according to this git hub issue but I don't think it is high on the priority list. I am guessing that they will be pushing yeoman templates since everything else they are doing in DNX now is looking more and more like node.

0
Roman Pokrovskij On

Now I can answer at least on third part of the question:

It should be possible to generate Web Api from EF6 model using Rolsyn, and then generate client side from web api using tools like yeoman.