Andreas
Andreas

Reputation: 2366

EPI-Server 7 PropertyFor doesn't give me any intellisense

I'm learning EpiServer 7 built on MVC and am now trying to make the PropertyFor work as I want it. I have a property called title and if I write it like this (code below), it renders correctly but I dont't get any intellisense for the Linq expression inside (the x). You see what namespaces I am using and I have also added System.Linq in the webconfig for views. What do I need to do to get intellisense?

@using System
@using System.Data
@using EPiServer.Cms
@using EPiServer.Core
@using EPiServer.Web.Mvc.Html

@model MyApplication.Models.Pages.StartPage

<h2 class="@Html.EditAttributes(x => x.Title)">
    @Html.PropertyFor(x => x.Title)
</h2>

Note. The alloy MVC demo site have this problem for me as well so can't find any good solution there. I can't add System.Linq in the razor page, the page can't find the reference.

Thanks!

Upvotes: 0

Views: 441

Answers (1)

Andreas
Andreas

Reputation: 2366

A litle inactive thread but! We have one comment above that solved it in his way. For me I changed the target framework from 4.5 to 4.0 to 4.5. Voila!

Upvotes: 1

Related Questions