Copied to clipboard

Flag this post as spam?

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


  • Steve Morgan 1348 posts 4457 karma points c-trib
    Sep 22, 2014 @ 17:54
    Steve Morgan
    0

    Visual Studio - Setting up a separate project for MVC custom code in solution

    Hi,

    When I build Umbraco v7 sites I just create the MVC Models, Views, Controllers folders, store any custom classes under App_Code and put custom angular bits under the App_Plugins. This seems to be how it's done in the videos.. though I'd happily take any feedback here. 

    This works well but Visual Studio 2013 runs a like a dog.  I've seen some people create separate projects to hold their custom code under a solution - from Googling you create a MyProject.site and nuget Umbraco into it and then create a separate project for your custom code.

    All seems straight forward except I'm missing some Visual Studio referencing magic (and/ or build events?) at this point to make this build and work. I can easily add a reference in the Umbraco project to the custom one but how do I add the reference to the necessary Umbraco files so that I can write my custom code with intellisense goodness - can I just add Model, Views (with a Partials sub dir?) .. etc folders in this?

    Are there any special build and deployment considerations with this approach? 

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Sep 22, 2014 @ 18:18
    Ismail Mayat
    0

    Steve,

    Take a look at http://our.umbraco.org/projects/developer-tools/hybrid-framework some really good pointers on best way to work with umbraco and mvc.

    Regards

    Ismail

  • Paul Gower 28 posts 74 karma points
    Jun 02, 2015 @ 20:41
    Paul Gower
    0

    Ismail,

    Is this Hybrid Framework the way you would recommend doing new development in Umbraco v7?  

    Steve, like you I have heard people refer to having 2 projects for Umbraco to keep the "custom code" separate.  What did you decide to do?  Any insights you have would be greatly appreciated as I am working in Umbraco for the first time on the current project I am working on.

    Thanks,
    Paul 

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jun 02, 2015 @ 21:25
    Ismail Mayat
    1

    Paul,

    At cogworks we have separate projects, if starting out I highly recommend hybrid jeoren and Jeavon know what they are doing and have out together really nice solution in hybrid.

     

    Regards

     

    Ismail

  • Steve Morgan 1348 posts 4457 karma points c-trib
    Jun 03, 2015 @ 11:25
    Steve Morgan
    0

    Hi Paul,

    No - I kept it in one project. Unless I'm debugging I just keep running the site without debugging enabled (ctrl + F5) and it's swift. I also had an issue in visual studio which seemed to cause it to slow down - nothing to do with the Umbraco project. 

    I feel like there is definitely a lot of scope of doing things better though. Waiting for a wet weekend to have a proper look at the Hybrid framework - I usually like to keep things vanilla though to avoid barriers in upgrades.

    HTH 

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft