Switching 4.1 to 4.2 module
Hey all,
I have a module written in Sitefinity 4.1 . I've switched to sitefinity 4.2, but my custom modules have following error:
Unable to upgrade database schema metadataSource provided by '[ModuleName].Data.Implementation.OpenAccessProvider': No metadata has been registered for class [ModuleName].Model.ArticleItem. (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.2/Projects/[projectname]/bin/[moduleName].DLL.)
* ArticleItem is an instance of the module.
Cheers,
Majid
Hi Majid,
The error indicates your module is not enhanced for your Sitefinity 4.2. Make sure you have Sitefinity SDK installed. Enhancing of modules is done with enhancer.exe located in SDK/Content/Common/Dependencies.
Then make sure the .csproj file of your module looks like this.
<
UserPropertiesOpenAccess_ConfigFile
=
"App.config"
OpenAccess_ConnectionId
=
"DatabaseConnection1"
OpenAccess_Enhancing
=
"True"
OpenAccess_UpdateDatabase
=
"False"
OpenAccess_EnhancementOutputLevel
=
"1"
/>
</
VisualStudio
>
</
ProjectExtensions
>
<
PropertyGroup
>
<
PostBuildEvent
>
</
PostBuildEvent
>
<
PreBuildEvent
>
</
PreBuildEvent
>
</
PropertyGroup
>
<
PropertyGroup
>
<
OpenAccessPath
>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</
OpenAccessPath
>
</
PropertyGroup
>
<
ImportCondition
=
"Exists('$(OpenAccessPath)\OpenAccess.targets')"
Project
=
"$(OpenAccessPath)\OpenAccess.targets"
/>
</
Project
>
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
Hi Majid,
Sitefinity doesn`t migrate modules when sitefinity project is upgraded to a higher version. Can you open a support ticket and send me the module before you upgraded it (as it was working in previous version). I will try to add it to Sitefinity 4.2 project at my end.
Additionally I presume you have Sitefinity 4.2 SDK installed(with the new version of OpenAccess). It is needed for module enhancing because enhancer.exe is located in
<
PropertyGroup
>
<
OpenAccessPath
>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</
OpenAccessPath
>
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Hi Stanislav,
Thanks for your reply.
I've sent a support ticket attached full solution of my project.The ticket number is
460616.
Cheers,
Majid
Hi,
The problem must be resolved urgently. please take a look at support ticket referred above.
Thanks,
Majid
Hello Majid,
I have downloaded and successfully installed your modules. You have to enhance the modules with this like in each module .csproj file
<
UserProperties
OpenAccess_EnhancementOutputLevel
=
"1"
OpenAccess_UpdateDatabase
=
"False"
OpenAccess_Enhancing
=
"True"
// it was set to False
OpenAccess_ConnectionId
=
"DatabaseConnection1"
OpenAccess_ConfigFile
=
"App.config"
/>
</
VisualStudio
>
</
ProjectExtensions
>
<
PropertyGroup
>
<
PostBuildEvent
>
</
PostBuildEvent
>
<
PreBuildEvent
>
</
PreBuildEvent
>
</
PropertyGroup
>
<
PropertyGroup
>
<
OpenAccessPath
>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</
OpenAccessPath
>
<
OpenAccessPath
>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</
OpenAccessPath
>
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
HI Stanislav,
1. I found out my problem wasn't about the modules migration, It's about Navigation controls.
My modules work well in Sitefinity 4.2 now , but I have the following error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.Detail.DetailFormView.SetUpNavigation(IDetailFormViewDefinition def) +17 Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.Detail.DetailFormView.OnPreRender(EventArgs e) +52 System.Web.UI.Control.PreRenderRecursiveInternal() +134 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Control.PreRenderRecursiveInternal() +204 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6881 |
Hi Majid,
1. This can be caused by multilingual templates on the site. It is possible that some overlapping language templates might be causing the issue.
A template might causing an internal loop which fills the memory of the server thus throwing an exception. Please check if you have any layout controls that might be causing the issue or if you have applied other changes to the masterpage that you use for your pages that are throwing the error.
Resolving this will include examining the template that a problematic page uses and its layout controls, making changes to the layout controls or removing and then adding new language version to page template might resolve it. Excuse me for the resolution that is not focused on simple steps, but the random issue acts unpredictable and there are many factors that take part in its cause.
The previous stack trace:
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
System.Collections.Generic.List`1.set_Capacity(Int32 value) +93
System.Collections.Generic.List`1.Add(T item) +74
Telerik.Sitefinity.Modules.Pages.PageHelper.GetTemplates(PageNode pageNode) +91
Telerik.Sitefinity.Web.PageSiteNode.LoadPageData() +971
Telerik.Sitefinity.Web.PageSiteNode.get_Visible() +16
Telerik.Sitefinity.Web.RouteHelper.CheckSiteMapNode(SiteMapNode pageSiteMapNode) +468
Telerik.Sitefinity.Web.UI.NavigationControls.NavigationControl.InitializeSiteMapDataSource() +873
Telerik.Sitefinity.Web.UI.NavigationControls.NavigationControl.InitializeControls(GenericContainer container) +104
Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +82