Copied to clipboard

Flag this post as spam?

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


  • Gareth Evans 143 posts 335 karma points c-trib
    Jan 25, 2011 @ 23:21
    Gareth Evans
    1

    Building 4.6.1 from Fork

    Hi Guys

    I am planning to look into some bugs/features and I would like to have a working BackOffice/Umbraco environment to test possible fixes.
    I'm having a problem getting the MacroEngines working when I'm building from source, but first a quick summary of what i've done so far that might help someone else in the future.

    I've done a lot of .net but getting a working build environment proved tough- especially when I couldn't find any information on the actual project structure (just how to fork etc) and some of the tricks such as web.config xslt

    Thanks to some excellent help from @slace and @umbraco on twitter, i've followed these guides:

    http://our.umbraco.org/wiki/how-tos/how-to-submit-patches-for-the-umbraco-core
    http://our.umbraco.org/wiki/how-tos/contributing-to-umbraco
    http://www.aaron-powell.com/umbraco-and-mercurial-how-to-contribute
    http://www.aaron-powell.com/mercurial-101-for-umbraco-developers

    I grabbed mercurial from here: http://mercurial.selenic.com/

    Paraphrasing, I  created a fork on codeplex (from here http://umbraco.codeplex.com/SourceControl/list/changesets) ;, then performed a clone (hg cl <reposurl>) and then update (hg up 4.6.1) - see the aaron-powell links above.

    From there, I fired up the umbraco.sln in VS2010 and hit f5.

    First problem I encountered was the releaseValidation attribute on the httpRuntime element/node in the web.config. This may be related to the problem I start describing at the bottom of this, but for now, I just removed it.

    This wouldn't parse, and I've definitely got .net4 installed. It seems the umbraco.presentation project is 3.5 though, so this may be related.

    Second problem I encountered was that by default, the web.config file in the source tree is a configured umbraco instance.
    This means that if you don't already do development for umbraco, you'll need to create a database. 
    To do this, in the umbraco.presentation project, I observed there were some XSLT transforms for the web.config file, and each transform included a developer's computer/machine name.
    I created a copy of one of these files, named it the same as my machine name and then cleared the configuration status variable.

    This caused the installer to pop up, which I ran through. After this was done, I ensured the XSLT file for my webconfig had the right configuration status & connection string in it.

    I found that the password I set in the installer seemed to not stick, I don't know what happened here - I may have typed it wrong when I ran the installer.
    I discovered this by accident after I started another browser.
    I changed it using the change password window after I managed to find a browser session that still had cookies for the backoffice.

    Once I had the project starting up, I created some simple templates/xslt/content etc to check the umbraco site was working like I expected which it was. 

    So victory so far - the web.config transform tripped me up for a while because I couldn't figure out why the site showed a login prompt but wouldn't let me log in and couldn't find any documentation on what the default password was (I originally assumed it was using a shipped CE database and started a database server up as part of the build)

    Moving onto Razor, which is what I wanted to debug/play with, I went to the developer->scripting section in the backoffice and clicked Create.

    The first thing I noticed is there were no scripting engines available.

    A quick trace through the code showed me that there was nothing in the runtime inheriting from IMacroEngine, though there was source in the project (strangely enough, SolutionNavigator didn't find this when I searched for IMacroEngine)

    Some help from @umbraco and if you want to develop 4.6.1 you need to change the default build options (in configuration manager at the bottom of the debug/release dropdown) to enable building of the MacroEngines project.

    This is where i've come unstuck.
    If I enable just Umbraco.MacroEngines, and build, I still get no scripting engines for selection.
    If I enable Umbraco.MacroEngines.Legacy for building, I get a .net 4 exception about the assembly being built by a runtime newer than the currently loaded runtime. Once I did this, it seems i can't go back - the assembly always tries to load - I might need to delete it manually from the bin folder?

    If I change the Umbraco.Presentation project to .net4, it doesn't build - throwing a bunch of errors.

    What do I do from here?

     

    Gareth
    Sniper Systems Ltd

     

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jan 25, 2011 @ 23:29
    Niels Hartvig
    0

    Make sure to copy the Umbraco.MacroEngines.Juno assemblies to your bin folder of the presentation project along with the dependencies (system.razor, etc.) - it's not copied automatically.

  • Gareth Evans 143 posts 335 karma points c-trib
    Jan 25, 2011 @ 23:41
    Gareth Evans
    0

    Hi Niels

    If I try and open Umbraco.MacroEngines.Juno (c# project) then it opens the main umbraco solution.

    Is the reason it's not a reference because it would cause a circular dependency?
    Using explorer, I copied the *.dll, *.pdb files that weren't present from the Umbraco.MacroEngines.Juno\bin folder to umbraco\Umbraco,presentation\bin 

    I also deleted Umbraco.MacroEngines.Legacy (which was leftover from when I accidentally built that project) from the bin folder

    Now I'm getting "Could not load file or assembly 'Microsoft.Scripting' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded"

    This suggests the umbraco.presentation project needs to have it's target framework changed to .Net Framework 4

     

    Gareth

  • Gareth Evans 143 posts 335 karma points c-trib
    Jan 25, 2011 @ 23:50
    Gareth Evans
    0

    Should add that if I change the umbraco.presentation project to be .net4 then the solution won't build - i've had this before when a project is mixed 3.5/4 - all the projects in the solution have to be either 3.5 or 4.

    I must be missing something here...

    Should I change all the projects that aren't working to 4?


    Gareth

  • Gareth Evans 143 posts 335 karma points c-trib
    Jan 26, 2011 @ 04:46
    Gareth Evans
    0

    Changed umbraco.presentation, umbraco.webservices, umbraco.editorControls, umbraco.Linq.Core projects to be .net4 projects after turning on build in configuration manager for umbraco.MacroEngines

    After I did that, the project built and runs with the MacroEngines like I expected

    When I did the update, I used 4.6.1 as the tag to update to- it's possible that tag had some 3.5 downgrades committed to it?

  • Keith Petersen 67 posts 111 karma points
    Jan 31, 2011 @ 16:51
    Keith Petersen
    0

    Thanks for taking the time to document this.

  • Gareth Evans 143 posts 335 karma points c-trib
    Jan 31, 2011 @ 21:22
    Gareth Evans
    0

    no problem

    also the path on one of the build rules on umbraco.macroEngines (is wrong, it needs a umbraco after the ..)

    you can manually copy the dll files from the macroengine into the presentation bin, like neils suggested but i found after fixing the build rule I didnt have to

     

    Niels - it wasn't copying automatically because of the broken rule but it was set up to do this

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 03, 2011 @ 22:45
    Lee Kelleher
    0

    Hi Gareth,

    Just wanted to say a big Thanks for your original post, I've started to "play" with the core and got tripped up by the XSLT transform on the web.config.

    Owe you a couple of beers at CG11! ;-)

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft