code generation - Sitecore Glass Mapper always null -
i using sitecore glass mapper new project i'm setting up. using sitecore 7.2, latest version of team development sitecore (tds) code generation , latest version of glass.
the code trying execute:
var b = new sitecorecontext(); var c = b.getcurrentitem<t01_homepage>();
b not null. c null.
var d = b.getitem<t01_homepage>("path")
d null.
i added assembly in glassmappersccustom:
public static iconfigurationloader[] glassloaders(){ var attributes = new attributeconfigurationloader(new[] { "company.framework.websites.corporate", "company.framework.core", "company.framework.common" }); return new iconfigurationloader[] { attributes }; }
when b.glasscontext.typeconfigurations models there.
i figured language issue because site in dutch , maybe wrong language resolved incorrectly. not case.
i disabled webactivator , added glassmappersc.start() in global.asax application_start method.
we using autofac di framework. without it, still isn't working can see above. when create own custom models without tds code generation result of getcurrentitem<t>
null.
does have idea how can fix this?
did check sites.config , default language website? there difference between language defined in sitecore languages folder , configuration.
i had similar problem 1 of projects changed sitecore.context.language "nl" instead of "nl-nl". glass mapper return null, sitecore.context.database.getitem return object in case.
Comments
Post a Comment