iodum
iodum

Reputation: 103

Sitefinity 4.1 custom module

I'm tried to install the Products module. I've done based on the tutorial (add to sample a few fields) but after restating the app I got this error:

No metadata has been registered for class ProductCatalog.Model.ProductItem. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced. The class was loaded from file:///C:/Program Files/Telerik/Sitefinity 4.1/Projects/pssite/bin/ProductCatalog.DLL.)

Stack Trace:

[OpenAccessException: No metadata has been registered for class ProductCatalog.Model.ProductItem. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced. The class was loaded from file:///C:/Program Files/Telerik/Sitefinity 4.1/Projects/pssite/bin/ProductCatalog.DLL.)]
   DynamicModule.ns.Wrapped_OpenAccessRoleProvider_975c8a0a334c43b7a81f0a078afb63cf.GetRolesForUser(Guid userId) +230
   Telerik.Sitefinity.Security.SitefinityPrincipal.Initialize() +1036
   Telerik.Sitefinity.Security.SitefinityPrincipal.get_Roles() +9
   Telerik.Sitefinity.Configuration.RolePolicyHandler.GetPolicyNames(ConfigProvider configProvider, ConfigSection section) +46
   Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value) +101
   Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value) +87
   Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop) +56
   Telerik.Sitefinity.Services.SystemConfig.get_CacheDependencyHandlers() +68
   Telerik.Sitefinity.Data.CacheDependency..cctor() +79
[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Data.CacheDependency' threw an exception.]
   Telerik.Sitefinity.Data.CacheDependency.Subscribe(Type handlerType, Object trackedItem, ChangedCallback callback) +0
   Telerik.Sitefinity.Configuration.ConfigCacheDependency.Initialize(CacheItem owningCacheItem) +74
   Telerik.Microsoft.Practices.EnterpriseLibrary.Caching.CacheItem.InitializeExpirations() +30
   Telerik.Microsoft.Practices.EnterpriseLibrary.Caching.Cache.Add(String key, Object value, CacheItemPriority scavengingPriority, ICacheItemRefreshAction refreshAction, ICacheItemExpiration[] expirations) +508
   Telerik.Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager.Add(String key, Object value, CacheItemPriority scavengingPriority, ICacheItemRefreshAction refreshAction, ICacheItemExpiration[] expirations) +28
   Telerik.Sitefinity.Configuration.ConfigSection.HasPolicy(ConfigPolicyHandler policyHandler, String policyName, PolicyStatusInfo& policyStatus) +186
   Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value) +182
   Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value) +87
   Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop) +56
   Telerik.Sitefinity.Configuration.ConfigElement.get_Item(String propertyName) +68
   Telerik.Sitefinity.Security.Configuration.SecurityConfig.get_ApplicationRoles() +17
   Telerik.Sitefinity.Security.SitefinityPrincipal.get_IsBackendUser() +56
   Telerik.Sitefinity.Security.SecurityManager.AuthenticateRequest(HttpContextBase context) +932
   Telerik.Sitefinity.Web.SitefinityHttpModule.Context_AuthenticateRequest(Object sender, EventArgs e) +18
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +168
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76*

I'm using SF4.1 Did anyone else get this error?

Upvotes: 1

Views: 1521

Answers (1)

SelAromDotNet
SelAromDotNet

Reputation: 4815

This problem is almost always a misconfiguration of open access for the project when using the fluent mapper for your data model.

You need to unload the project and edit the .csproj file to enhance it for openaccess. For specific instructions, check this link under the section "Integration with OpenAccess Enhancer": http://www.telerik.com/help/openaccess-orm/fluent-mapping-getting-started-fluent-mapping-api.html#Integration_with_OpenAccess_Enhancer

Let me know if this doesn't resolve the problem

hope this was helpful!

Upvotes: 1

Related Questions