Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • J 445 posts 862 karma points
    Dec 14, 2019 @ 10:39
    J
    0

    Controllers Folder missing Umbraco 8.4

    Carried out the instructions (https://our.umbraco.com/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget) for the latest version of Umbraco (8.4) and was about to create a Controller.

    The Controller folder doesnt exist but Views does. Have i done something wrong or do i need to install something in addition to the instructions provided? Or simply just create it manually (Not listed in the steps on that link so i assume i have done something wrong), perhaps this is a bug?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Dec 14, 2019 @ 12:12
    Alex Skrypnyk
    0

    Hi J

    What type of project are you using in Visual Studio? You can just create the Controllers folder, it's just a folder.

    Thanks, Alex

  • J 445 posts 862 karma points
    Dec 14, 2019 @ 12:33
    J
    0

    Hello Alex

    I used an Empty Project.

    If i could create the folder myself then would it be advisable to have a class library to hold these or should it reside within the website project? What about the classes that come as default with an MVC project (startup, routes etc, could i just copy them from another clean project?)Thanks

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Dec 14, 2019 @ 17:22
    Marc Goodson
    2

    Hi J

    When you create your new Visual Studio project, if you choose 'empty' then there are a couple of checkboxes that can be ticked: MVC and Web API that will add the normal folders you expect to see in a solution, eg Controllers etc:

    enter image description here

    Then install Umbraco via Nuget into the project.

    Now where you add your Controllers will depend a little on what you are building, who you are working with, where you are hosting, and how close you want to stick to MVC conventions etc

    Some people feel an MVC application should follow the convention of Controllers created inside a folder called Controllers in the MVC project, same with Views, same with Models... but they can live in a class library if that makes more sense to how you want to work... usually Models might live in a class library as they could be used in other projects - controllers feel more like plumbing and are 'usually only used in the web project, hence the convention. If your using Umbraco Cloud then the main web application will be a 'website' project, so people tend to put the controllers in a seperate class library. Umbraco isn't a 100% architected project following MVC conventions, it's still very much a template/view-first rather than route-first approach to implementing a solution, so it's finding something that works for what you are building and how you work, rather than following one 'best practice' way...

    if that helps :-P

    regards Marc

Please Sign in or register to post replies

Write your reply to:

Draft