For some reason, Visual Studio gives me this error in the view:
Cannot convert lambda expression to type 'System.Linq.Expressions.Expression>' because it is not a delegate Type
Also, I don't have intellisense on lambda.
I made sure to bring my MVC version down to 5.1.0 based on this post:
Sitecore editable glass cannot convert lambda expression
Unfortunately, I did not have the points necessary for commenting directly on this post. Unfortunately, the MVC solution for the version does not work for me. When I publish for deployment, the data comes in just fine - editing works just fine - but I would rather not just ignore the red squiggly lines and the lack of intellisense.
From the new Sitecore 8 / Visual Studio MVC application setup I Ran:
Update package Glass.Mapper.Sc.CastleWindsor to give me v3.3.1.26
Then I launched Install-Package Glass.Mapper.Sc.Mvc-5 to give me v3.3.1.48
I installed the model
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Glass.Mapper.Sc;
using Glass.Mapper.Sc.Configuration.Attributes;
namespace myns.app.Models
{
[SitecoreType]
public class BaseContent
{
[SitecoreId]
public virtual Guid Id { get; set; }
[SitecoreField("Content Title")]
public virtual string Title { get; set; }
[SitecoreField("Summary Content")]
public virtual string Summary { get; set; }
[SitecoreField("Full Content")]
public virtual string Content { get; set; }
[SitecoreField("Content Image")]
public virtual Glass.Mapper.Sc.Fields.Image ImagePath { get; set; }
}
}
And have a working view
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<myns.app.Models.BaseContent>
<div>
<h4>BaseContent</h4>
<hr />
@Model.Title
<p>@Editable(Model, x => x.Title)</p>
<p>@Editable(Model, x => x.Summary)</p>
<h5>content</h5>
<p>@Editable(Model, x => x.Content)</p>
<p>@RenderImage(Model, x => x.ImagePath)</p>
</div>
Thank you in advance for your entry!
UPDATE : When I comment on the next three lines in compilation assemblies > in the web.config Sitecore file, the problem seems to disappear. Not sure if this is the best you can do:
<compilation defaultLanguage="c#" debug="false" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=5.2.2.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>