I sometimes receive an error when I open a page in page editor mode on my Sitecore site using Glass.Mapper.
You cannot save a class that does not contain a property that represents the item ID. Ensure that at least one property has been marked to contain the Sitecore ID. Type: Castle.Proxies.IBasicPageProxy at Glass.Mapper.Sc.Configuration.SitecoreTypeConfiguration.ResolveItem(Object target, Database database) at Glass.Mapper.Sc.GlassHtml.MakeEditable[T](Expression'1 field, Expression'1 standardOutput, T model, Object parameters, Context context, Database database, TextWriter writer)
This appears in the place of the rendering, so it doesn't show up as a standard ASP error.
Restarting IIS solves this, but soon it appears again..
I use interfaces for model definitions, with every single interface inheriting from IBaseType:
[SitecoreType]
public interface IBaseType
{
[SitecoreId]
Guid Id { get; set; }
[SitecoreInfo(SitecoreInfoType.Name)]
string Name { get; set; }
[SitecoreItem]
Item InnerItem { get; set; }
[SitecoreInfo(SitecoreInfoType.Url)]
string Url { get; set; }
[SitecoreInfo(SitecoreInfoType.TemplateId)]
Guid TemplateId { get; set; }
[SitecoreInfo(SitecoreInfoType.FullPath)]
string FullPath { get; set; }
}
I use Sitecore 7.5 rev. 141003 (.NET 4.5, MVC5), and the latest versions of Glass.Mapper related NuGet packages currently:
The issue appears on all machines we tried, but all of them uses Windows 8, IIS 8.5.9600. I tried reverting to the WebActivator method, but it didn't help. Model definitions are in a separate class library project, which references all glass mapper assemblies.
I'm pretty clueless, never run into this error before on other projects. Does anyone have any idea what can cause this, or how I could debug it?
Thank you for your help!
I have put below code in my model and it works
[SitecoreId]
public virtual Guid Id { get; set; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With