Copied to clipboard

Flag this post as spam?

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


  • Brad 94 posts 151 karma points
    Feb 21, 2013 @ 01:47
    Brad
    0

    Compile error in Umbraco Razor in Visual Studio

    As if learning Umbraco developement in Visual studio is not complex enough....

    I have loaded my new Umbraco 6 site up in Visual Studio 2010.

    When I try to compile the project however i get two very odd and basic errors in the Umbraco supplied code..

    Missing something?

    This error is in a file called \scripting\templates\cshtml\ListChildPagesOrderedByProperty.cshtml  

    Needless to say the error is..

    Missing ;

     

    I get two of these errors. I could just fix them, but I want to know if this code is 'refreshed' by Umbraco.

    Also, what other little coding errors might i encounter in the Umbraco 6 code base.

     

     

     

     

     

  • Brad 94 posts 151 karma points
    Feb 21, 2013 @ 02:06
    Brad
    0

    So I fixed the first error for now by adding a semi colon.

    Now when I compile I get this error..

     

    This is in the file ListChildPageWithDoctype.cshtml

    I'm getting the feeling Umbraco 6 does not play nice with Visual Studio 2010. Could that be right?

     

  • Brad 94 posts 151 karma points
    Feb 21, 2013 @ 23:13
    Brad
    0

    Next I installed Visual Studio 2012 Express and loaded the project into that. The error remains..

    So, it seems the new Umbraco 6 site runs but it does not compile. (?)  

    How on earth do I set this up in Visual Studio so it does compile?

    Next I'll try Web Matrix. In the mean time, anyone have this compiling in Visual Studio of any flavor?

     

     

  • Charles Afford 1163 posts 1709 karma points
    Feb 21, 2013 @ 23:32
    Charles Afford
    0

    Hi the 'query' you are passing in as a parameter?  What type is it and what is its value?  Is it a umbraco method?  In which case you need a @ and namespace informat of it.

  • Brad 94 posts 151 karma points
    Feb 22, 2013 @ 02:11
    Brad
    0

    I did not pass the parameter or write the code. This code is part of the Umbraco code. I've not touched it. I'm not passing anything.

  • Brad 94 posts 151 karma points
    Feb 22, 2013 @ 06:29
    Brad
    0

    Ok found the solution..

    You do not compile the Umbraco code.. Instead you can create a new Visual studio solution, have Umbraco as one project, and do your coding in another.

    You can see a good tutorial for that here.

    http://cultiv.nl/blog/2009/6/1/easily-debug-your-custom-umbraco-user-controls-in-visual-studio/

    This works for me in Umbraco 6

     

     

     

  • Charles Afford 1163 posts 1709 karma points
    Feb 23, 2013 @ 21:50
    Charles Afford
    0

    Ah i see what you were trying to do.  Yes create a dll project and a www root project.  Build the dll project into the wwwroot bin.  You can open the wwwroot in VS using open website.  That will make things easier :).  Charlie :).

  • Niels Lynggaard 190 posts 548 karma points
    Apr 10, 2013 @ 15:34
    Niels Lynggaard
    0

    I was having the exact same issues, when trying this setup with one website-project and a project for code in vs..

    There are 5 cshtml files that contain errors when I am building my project, so what I did was actually just excluding these 5 files from my solution, since I'm not using razor at the moment.. This solves it, but it properbly be better to just fix the few errors in the .cshtml files.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft