Scaffolding controller doesn't work with visual studio 2013 update 2

后端 未结 16 3202
别跟我提以往
别跟我提以往 2020-11-27 03:54

PROBLEM:

I have updated to Visual Studio 2013 update 2 and now I cannot scaffold controllers.

The problem is not project specific: when I try to scaffold

16条回答
  •  误落风尘
    2020-11-27 04:16

    I have performed following to solve this issue:

    1. In Package Manager check if you have MVCScffolding or T4Scaffolding (Core or pre release for vs2013)
    2. Uninstall all packaged that depend on any of MVCScaffolding or T4Scaffolding
    3. Copy CodeTemplates Folder in full (Do not replace your custom templates but make sure you have rest of the files from root of this folder. I take that you have done that part as you have customised some templates so you know where this folder is)
    4. Build Your project and close it.
    5. Restart Visual Studio under admin mode
    6. Open Package Manager Console (it should not have any errors and you can see PM> without errors.
    7. Right Click on Controller folder and choose Add->New Scaffolding Item or Choose Add->Controller both should ask which one you want and then choose MVC5 scaffold or which ever appears in list.
    8. You will then get to select your parameters if its controller you might need to choose DBContext or repository etc.

    This produced the controller and relevant views for me.

    I added a custom partial view called QuickView in that folder however this scaffolding procedure did not consider that and only generated views that it was doing by default. I am not sure if you need to add these custom views in a file to tell Scaffolder to generate those as well.

提交回复
热议问题