Reputation: 1258
So, i'm developing my razor macroscripts in Visual studio for my Umbraco project. Everything is working fine, but there are two things really annoying.
Is there a way to configure my project to use this features? Didn't find a .cshtml template yet.
Upvotes: 8
Views: 19807
Reputation: 1258
From Umbraco 6 on it's very convenient to install Umbraco on your local file system with Visual Studio and NuGet. Given that you have the MVC Framework installed and you use Visual Studio 2012 or above, you get full Razor support in Visual studio. Umbraco Our has a great blogpost about this where they described the steps below in detail (with screenshots!).
Install-Package UmbracoCms
)Upvotes: 0
Reputation: 10922
You need to have the MVC Framework installed, then when you open the project as a website, you should be able to create and edit cshtml files with syntax highlighting. See my answer to the following post for more details:
Setting up local development environment for Umbraco
Upvotes: 5
Reputation: 9051
As an alternative if you go into the Umbraco admin, go to the 'Developer' section and right click on 'Scripting Files' you can create razor scripts directly (and this will save the new .cshtml directly into your 'macroScripts' folder - although in VS2010 you will need to right click on the new script and choose 'include in project').
Also this will allow you to base your new razor macroscript on one of the pre-built snippets so you may get a bit of core functionality for free.
Upvotes: 1
Reputation: 4257
If your project is a web site/application then the mvc templates aren't available (they only show up in MVC projects). You can just create a text file and name it with the .cshtml extension though (you could set up your own template for this in VS if you wanted to).
To get intellisense in your Razor files, see Doug Robar's blog post on the subject
Upvotes: 3