Copied to clipboard

Flag this post as spam?

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


  • Ishan Vyas 67 posts 198 karma points
    Nov 30, 2018 @ 06:52
    Ishan Vyas
    0

    Adding MVC & Web Api folders and core reference to existing asp.net empty template project

    hii there!!! i am confused in this topic as i want to add mvc and web api to my existing .net project which has umbraco installed in it. As at the time of installing umbraco i didnt selected the mvc and web api folders from below figure so it wont have folder and references associated with both in my project.enter image description here

    now how can i install both of them into my umbraco installed .net web application project??

    i searched this and gone through solutions of installing it through nutget package but when installed mvc package it does not show the reference folders associated with it like App-start and global.asax.cs etc.. as below figure shows

  • Pawel Bres 39 posts 160 karma points c-trib
    Nov 30, 2018 @ 09:19
    Pawel Bres
    0

    Hi there, why you would like to install MVC and Web API additionally? It's already included in the Umbraco app. You can always add App_Start folder directly from VS.

    Greetings

    Pawel

  • Ishan Vyas 67 posts 198 karma points
    Nov 30, 2018 @ 11:30
    Ishan Vyas
    0

    hii there!!!

    Actually i want to add web api into my site and for that i have to make changes in many file one of that is in webapiconfig , global.aspx.cs, etc but how can i add it when i dont have those file loaded up as i have used empty template at time of installation, so some of the folders and files will not be created which gets created when we tick both mvc & web api in the new project creation window as i shown above figure.

  • Ishan Vyas 67 posts 198 karma points
    Nov 30, 2018 @ 12:20
    Ishan Vyas
    0

    can you please tell me how to add those folders which are associated with MVC and web api packages. as i dont see any way to add it in visual studio.

  • Laura Weatherhead 25 posts 153 karma points MVP 5x c-trib
    Nov 30, 2018 @ 12:39
    Laura Weatherhead
    3

    Hi Ishan,

    You can right-click on the project (just above the "References" tree node) to add a new Folder or item. Pawel is right - the Web API config file would usually sit within a folder called "App_Start" along with routing and start-up configuration. You already have a Global.asax file in the root of your project.

    However - Umbraco allows you to create controllers that inherit UmbracoApiController (read more about it here: https://our.umbraco.com/documentation/reference/routing/webapi/) which will open endpoints on /umbraco/api/ (although this can be route can be customised).

    I wouldn't get too stressed about not selecting the correct templates during the project set-up: sometimes it's harder sorting through and customising the provided patterns than it is just building your own :)

    Hope that helps a little.

    Cheers,

    Laura

Please Sign in or register to post replies

Write your reply to:

Draft