Installing Products Module
I'm using SF4.1 an tried to install the Products module. I've done everything based on the tutorial but after restating the app I got this error:
It looks like the module has not been enhanced. The error you get indicated that you have a class that is not mapped in the OpenAccess metadata. There can be various reasons for this. If you have an Open Access provider that is used to manipulate this persistent type it should declare the assembly where this persistent class is located, this happens in the GetPersistentAssemblies method of the provider. Also is the class marked as persistent with the Persistent attribute?
Hello FlR,
Greetings,
Ivan Dimitrov
the Telerik team
The class has the persisten attribute:
[DataContract(Namespace = "http://sitefinity.com/samples/productcatalogue", Name = "ProductItem")]
[ManagerType("ProductCatalogSample.Data.ProductsManager, ProductCatalogSample")]
[Persistent(IdentityField = "contentId")]
public class ProductItem : Content, IApprovalWorkflowItem, ISecuredObject, ILocatable, ISitefinityCustomTypeSerialization
About the provider, I'm not sure. In order to install the products module I've folllowed the next steps
1. Create with SF Project Manager an application
2. Added the Products sample to the solution
3. Recompile everything
4. Moving the dlls of Products sample to website bin
5. Installing the module using SF Admin interface
Shouldn't the system made behind all the necessary updates to make the Products module working?
Hello FlR,
Have you enhanced the custom module?
Kind regards,
Ivan Dimitrov
the Telerik team
Hi Ivan,
I have the same issue for my custom module after upgrading from SF 4.1 on SF 4.1 SP1.
In the *.csproj file I have the following declaration for OA enhancement:
<
ProjectExtensions
>
<
VisualStudio
>
<
UserProperties
OpenAccess_EnhancementOutputLevel
=
"1"
OpenAccess_UpdateDatabase
=
"False"
OpenAccess_Enhancing
=
"False"
OpenAccess_ConnectionId
=
"DatabaseConnection1"
OpenAccess_ConfigFile
=
"App.config"
/>
</
VisualStudio
>
</
ProjectExtensions
>
<
PropertyGroup
>
<
OpenAccessPath
>c:\Program Files\Telerik\Sitefinity 4.1\SDK\Content\Common\Dependencies\</
OpenAccessPath
>
</
PropertyGroup
>
<
Import
Condition
=
"Exists('$(OpenAccessPath)\OpenAccess.targets')"
Project
=
"$(OpenAccessPath)\OpenAccess.targets"
/>
Some additional information.
I just noticed in the output tab in VS the warning message from OA enhancer:
MSBUILD : OpenAccess Enhancer warning : No persistent classes found. Is the metadata information missing?
What does it mean? I have never seen this message after compilation my module in SF 4.1.
My custom classes were not changed after upgrading from 4.1 to 4.1 SP1.
Best regards,
Anton
I get this error, too. The class is marked as persisten.
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
Hey Ivan,
How do you enhance a custom module?
Thanks,
Tim
http://www.telerik.com/help/openaccess-orm/fluent-mapping-getting-started-fluent-mapping-api.html#Integration_with_OpenAccess_Enhancer
editing the .csproj file in accordance with instructions solved this problem.
But I get another error
Could not find the specified key "ProductCommentsPageTitle" or class id "ProductsResources".
Stack Trace:
[ArgumentException: Could not find the specified key "ProductCommentsPageTitle" or class id "ProductsResources".]
Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, String key, CultureInfo culture, Boolean falback, Boolean throws) +454
Telerik.Sitefinity.Localization.Res.Get(String classId, String key, CultureInfo culture, Boolean fallback, Boolean throws) +168
Telerik.Sitefinity.Abstractions.AppSettings.GetResourceValue(String resourceClassId, String resourceKey, CultureInfo culture) +125
Telerik.Sitefinity.Descriptors.LstringPropertyDescriptor.GetValueFromResource(String value, CultureInfo culture) +121
Telerik.Sitefinity.Descriptors.LstringPropertyDescriptor.TryGetResourceValue(Object component, String& value, CultureInfo culture) +140
Telerik.Sitefinity.Descriptors.LstringPropertyDescriptor.GetValue(Object component, CultureInfo culture, Boolean throwException, CultureInfo[] defaultCultures) +58
Telerik.Sitefinity.Descriptors.LstringPropertyDescriptor.GetValue(Object component, CultureInfo culture, Boolean throwException) +71
Telerik.Sitefinity.Descriptors.LstringPropertyDescriptor.GetString(Object component, CultureInfo culture, Boolean fallback) +100
Telerik.Sitefinity.Model.Lstring.GetString(CultureInfo culture, Boolean fallback) +64
Telerik.Sitefinity.Model.Lstring.get_Value() +35
Telerik.Sitefinity.Web.PageSiteNode..ctor(SiteMapBase provider, PageNode pageNode) +2284
Telerik.Sitefinity.Web.SiteMapBase.GetChildNodes(SiteMapNode node, Boolean ifAccessible) +471
Telerik.Sitefinity.Web.SiteMapBase.GetChildNodes(SiteMapNode node) +12
System.Web.SiteMapNode.get_ChildNodes() +30
System.Web.SiteMapNode.get_HasChildNodes() +10
Telerik.Sitefinity.Web.UI.Backend.MainMenu.IsNodeEmpty(PageSiteNode node) +30
Telerik.Sitefinity.Web.UI.Backend.MainMenu.<IsNodeEmpty>b__6(PageSiteNode c) +4
System.Linq.WhereArrayIterator`1.MoveNext() +55
System.Linq.Enumerable.Count(IEnumerable`1 source) +200
Telerik.Sitefinity.Web.UI.Backend.MainMenu.IsNodeEmpty(PageSiteNode node) +252
Telerik.Sitefinity.Web.UI.Backend.MainMenu.<IsNodeEmpty>b__6(PageSiteNode c) +4
System.Linq.WhereArrayIterator`1.MoveNext() +55
System.Linq.Enumerable.Count(IEnumerable`1 source) +200
Telerik.Sitefinity.Web.UI.Backend.MainMenu.IsNodeEmpty(PageSiteNode node) +252
Telerik.Sitefinity.Web.UI.Backend.MainMenu.CreateRadMenuItemFromNode(SiteMapNode node) +100
Telerik.Sitefinity.Web.UI.Backend.MainMenu.OnLoad(EventArgs e) +408
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +168
System.Web.UI.Control.LoadRecursive() +168
System.Web.UI.Control.LoadRecursive() +168
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3485
Hi all,
Tim, you enhance the custom module by modifying the .csproj file, see more details on www.sitefinity.com/.../how-to-how-to-create-a-custom-content-based-module-preparing-your-working-environment.html in the bottom of the page.
Helga, can you open ProductsResources.cs and confirm if a resource key ProductCommentsPageTitle exists there? If not, you'll have to add it manually.
All the best,
George
the Telerik team