Switching 4.1 to 4.2 module

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

Switching 4.1 to 4.2 module

All Replies

Posted by Community Admin on 15-Aug-2011 00:00

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

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

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>


Greetings,
Stanislav Velikov
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 28-Aug-2011 00:00

Hey Stanislav,

1- I've upgrated the project by Sitefinity project manager.
2- I've changed the references to new version dlls for modules projects.
3- I fixed .csproj files of module projects:
   3.1: OpenAccess_Enhancing="True"
   3.2: <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />

but now I have following errors:
1. When I'm trying to load the project website, it gets lots of performance and after a while says:

Application id class 'Telerik.OpenAccess.RT.OID.GuidIdentity' must have field: 'public System.Guid Telerik.Sitefinity.GenericContent.Model.Content.contentId'


and sometimes

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source 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.

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
   System.Web.UI.Control.EnsureChildControls() +182
   System.Web.UI.Control.PreRenderRecursiveInternal() +60
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4201



and in Modules pages in backend I can see my entities but when I'm trying to update or add a new one it throw errors!

It seems as you told there is something wrong with migrating modules, so Could you please tell me how can I use Enhancing tool ?

Its pretty Urgent right now, and any help would be appreciated!
Thanks,
Majid!

Posted by Community Admin on 31-Aug-2011 00:00

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>
If you don`t have this installed please install it as it will enhance the module. For proper configuration of .csproj file please refer to productsmodule .csproj for Sitefinity 4.2.

Greetings,
Stanislav Velikov
the Telerik team

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

Posted by Community Admin on 03-Sep-2011 00:00

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

Posted by Community Admin on 06-Sep-2011 00:00

Hi,
The problem must be resolved urgently. please take a look at support ticket referred above.

Thanks,
Majid

Posted by Community Admin on 07-Sep-2011 00:00

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>

The enhancer is supplied with Sitefinity 4.2 SDK install the SDK at its default location(C:\ProgramFiles\Telerik\Sitefinity 4.2SDK) and you will be able to run the modules without problems. If you install it in other directory change the path here.

<OpenAccessPath>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</OpenAccessPath>


All the best,
Stanislav Velikov
the Telerik team

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

Posted by Community Admin on 10-Sep-2011 00:00

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:

Exception of type 'System.OutOfMemoryException' was thrown.


I understood that this error would be thrown, if I have a navigation control in page (I put a language selector in a page and saw what I told).
If you check some posts before in this thread, you can see this error with details. in stack trace, There is a reference to Navigation control.

2. I have another problem in Ecommerce module. when I want to add product in Ecommerce, I have this error:

     Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source 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.

Stack Trace:

[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

Please check these errors on the project which I sent you.

Thanks and Regards,
Majid

Posted by Community Admin on 14-Sep-2011 00:00

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

2. In the project you sent me I used only the modules because I was not able to run SitefinityWebApp. Can you send SitefinityWebApp that I can add to visual studio and examine the problem?

All the best,
Stanislav Velikov
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