Copied to clipboard

Flag this post as spam?

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


  • David Amri 214 posts 740 karma points
    May 09, 2017 @ 07:44
    David Amri
    0

    Missing folders VS installation?

    Hi,

    First of all, I'm a newbie and have tons of questions regarding Umbraco. These are a few of them...

    We have installed Umbraco in VS with nuget as a webapp. But I become a bit confused when reading tutorials etc regarding the file structure of the project.

    When searching the web for information about this I found out that I'm missing the "App_Code" folder, "xslt", "macroScripts" and "usercontrols" in my project, why?

    Also, at some point we need to start working with Models, Controllers and perhaps Events (as I understand it, events are for backend functionality). But where do I put these files in the VS project file structure?

    I've seen projects that have the following folders in the file structure "Models", "Controllers " and "Events". Why are these not added upon installation and can I add them later myself? Are there any guidelines how to add these?

    Best regards David

  • David Peck 690 posts 1896 karma points c-trib
    May 09, 2017 @ 07:56
    David Peck
    1

    Hi David,

    I fear that you may be trying to run before you can walk. Those folders aren't required. Add them by all means, but only if you have a need to.

    Folders like Models and Controller are MVC conventions for putting your classes in. You can put them in any folder you like, but don't. You can also put them in an external library.

    Events isn't a convention. Not sure where you saw that.

    Xslt - you almost certainly don't want/need this. It's used by an older technology.

    Good luck!

    David

  • David Amri 214 posts 740 karma points
    May 09, 2017 @ 08:39
    David Amri
    0

    Thanks for your input David. Regarding the folders structure etc I'm referring to Mark Bowser answer on Our 3 posts down.

    Cheers!

  • David Peck 690 posts 1896 karma points c-trib
    May 09, 2017 @ 08:49
    David Peck
    100

    Sure... well he is referring I believe to his projects which are of a reasonable level of complexity. I'm not saying that Mark is wrong, I'm just saying that you don't need to start creating these folders without cause. If you start creating Controllers then create a controllers folder.

    The other consideration here is related to Continuous Integration (CI). Systems like TeamCity, Jenkins and others will expect that you version control your source code. They will checkout your code, restore any nuget dependencies, and build. However (by default) they will only deploy files that are referenced in your solution. So you may which to include some folders if you need them to be deployed by CI. If you're not using CI then it isn't a concern.

  • Dennis Adolfi 1082 posts 6450 karma points MVP 6x c-trib
    May 09, 2017 @ 07:59
    Dennis Adolfi
    1

    Hi David.

    Welcome to Umbraco, hope you will enjoy it!

    The folders you are referring to are not created by default when you install Umbraco no. They are for you to create when you have the need for them, since you will probobly not create any xslt or user controls (old stuff) it´s not necassary to create these folder by default.

    The AppCode folder is a bit special. It´s not created by default, but you can obviously create it your self. Anything that you place in the AppCode folder will be compiled at runtime, meaning that if you drop a .cs class/or controller in the App_Code folder, they will be automaticly compiled and avalible for you to use in your views/code. A lot of devs like to work with all their custom code in this folder.

    As you mentioned, you can obviously create the traditional MVC folders Models and Controllers, but these will not be comiple automaticly, so you need a tool like Visual Studio to build you .dll files, and when moving functionallity to another server, you need to publish your .dll files for these models and controllers to function. (Whereas if you´d use the AppCode appproach, you would just have you publish the .cs files in the AppCode and they would automaticly work on the other server.)

    Hope this cleared things out.

    Best of luck to you!

    More about AppCode and Shared Folders: https://msdn.microsoft.com/en-us/library/t990ks23.aspx#Anchor1

  • David Amri 214 posts 740 karma points
    May 09, 2017 @ 09:32
    David Amri
    0

    Great,

    Thanks Dennis. This was certainly useful.

    / David

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies