Copied to clipboard

Flag this post as spam?

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


  • Khai 71 posts 161 karma points
    Mar 26, 2013 @ 21:51
    Khai
    0

    Visual studio Razor errors and no intellisense?

    So I've setup my project according this tutorial: http://our.umbraco.org/wiki/codegarden-2009/open-space-minutes/working-in-visual-studio-when-developing-umbraco-solutions and I'm using umbraco 6.02.

    So basically what I have is another web application ( not mvc ) where I want to create my razor scripts. However I do not have intellisense and visual studio doesn't understand the razor tags. Probably because my web application is not a MVC application, but I wonder if anyone has got this working, or has an alternative way for working with razor scripts in visual studio.

     

  • organic 108 posts 157 karma points
    Mar 27, 2013 @ 19:07
    organic
    0

    I don't know exactly what triggers Intellisense, but have had success developing razor scripts in Umbraco whether they are:

    1. inline razor scripts in WebForms templates.

    2. macros created in the Developer section of the Admin and pointing to a file in the /macroScripts folder.  (also Umb webforms)

    3. macros created in the Developer section of the Admin and pointing to a file in the /Views/MacroPartials that was also created in Developer section as a 'Partial View Macro File' (Umb MVC) I'm doing this for the first time today.

    All I do is right click the file 'Open in Visual Studio' without even having a project or solution open and I get intellisense.  You might want to try this newer instruction for working in Visual Studio, too.  Maybe installing an MVC instance of Umbraco with NuGet will get the DLLs referenced somehow.

    http://our.umbraco.org/projects/developer-tools/umbraco-visual-studio-project

  • Khai 71 posts 161 karma points
    Mar 28, 2013 @ 21:17
    Khai
    0

    I've already got it working! In my seperate webapplication, I added a web.config and copied some lines from the web.config of the umbraco website to register assemblies. 

  • Justin Moser 20 posts 92 karma points
    Aug 17, 2013 @ 13:27
    Justin Moser
    0

    @Khai Could you post the steps you followed to fix your issue please? I have the same problem (no intellisense, syntax highlighting or debugging for razor in VS 2013) and can't for the life of me figure out how to get it back! Thanks.

  • Khai 71 posts 161 karma points
    Aug 17, 2013 @ 15:24
    Khai
    0

    Hi Justin, ehm sorry I forgot exactly what lines you have to include in your web.config, but there were some lines for referencing MVC dlls. However I setup my umbraco projects differently now, I create an empty asp.net mvc 4 application and then use NuGet to install umbraco on top of it. I can highly recommend the nuget way to create your umbraco project. https://www.nuget.org/packages/UmbracoCms/

Please Sign in or register to post replies

Write your reply to:

Draft