Installing Products Module

Posted by Community Admin on 04-Aug-2018 13:10

Installing Products Module

All Replies

Posted by Community Admin on 16-May-2011 00:00

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:

No metadata has been registered for class ProductCatalogSample.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:///MyProject/bin/ProductCatalogSample.DLL.)


 No metadata has been registered for class ProductCatalogSample.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:///My Path/bin/ProductCatalogSample.DLL.)]
   DynamicModule.ns.Wrapped_OpenAccessRoleProvider_d131be7a64d440de95d2eadb053d4ad4.GetRolesForUser(Guid userId) +405
   Telerik.Sitefinity.Security.SitefinityPrincipal.Initialize() +1006
   Telerik.Sitefinity.Security.SitefinityPrincipal.get_Roles() +16
   Telerik.Sitefinity.Configuration.RolePolicyHandler.GetPolicyNames(ConfigProvider configProvider, ConfigSection section) +62
   Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value) +159
   Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value) +102
   Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop, ConfigPolicyHandler policyHandler, String policyName) +42
   Telerik.Sitefinity.Configuration.ConfigElement.get_Item(String propertyName) +56
   Telerik.Sitefinity.Security.Configuration.SecurityConfig.get_ApplicationRoles() +28
   Telerik.Sitefinity.Security.SitefinityPrincipal.get_IsBackendUser() +86
   Telerik.Sitefinity.Security.SecurityManager.AuthenticateRequest(HttpContextBase context) +1062
   Telerik.Sitefinity.Web.SitefinityHttpModule.Context_AuthenticateRequest(Object sender, EventArgs e) +104
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +182
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +256

Please tell me if is something I should do.

Thank you!

Posted by Community Admin on 16-May-2011 00:00


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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 16-May-2011 00:00

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?

Posted by Community Admin on 17-May-2011 00:00

Hello FlR,

Have you enhanced the custom module?

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 18-May-2011 00:00

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" />

But I still get the error:

No metadata has been registered for class ....


Any suggestions?

BTW, where can I find whether an assembly was enhanced?

Thanks in advance,
Anton.

Posted by Community Admin on 18-May-2011 00:00

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

 

Posted by Community Admin on 18-May-2011 00:00

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

Posted by Community Admin on 18-May-2011 00:00

Hey Ivan,

How do you enhance a custom module?

Thanks,
Tim

Posted by Community Admin on 19-May-2011 00:00


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

Posted by Community Admin on 25-May-2011 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed