No metadata has been registered for class 'SitefinityWebApp.Modules.Testimonials.Data.Testimonial
I want to add a custom module to my application so I am looking at starting with the Testimonials demo. My application is 6.0 4100 version but I can only download the SDK for the 6.1 4300 version. I downloaded it and expanded out the Testimonials example. I added an Empty Web Application to my solution and added in the files from the testimonials example adding in references to the 6.0 version dll's. I went into the csproj file and added in links to OpenAccess...the only version of which I have is from the 6.1 SDK..
<Import Condition="Exists('C:\Testimonials\Dependencies\OpenAccess.targets')" Project="C:\Testimonials\Dependencies\OpenAccess.targets" />
I build this project and see a message in the output window "MSBUILD : OpenAccess Enhancer warning : No persistent classes found. Is the metadata information missing?" Not sure if this is important
After this I take the Testimonials.dll file and put it into the bin directory on the test server. I go in the Sitefinity back-end Administration -> Modules & Services -> Install a module and add TestimonialsModule and SitefinityWebApp.Modules.Testimonials.TestimonialsModule. I reset the app pool and I see this error
No metadata has been registered for class
'SitefinityWebApp.Modules.Testimonials.Data.Testimonial, Testimonials,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. (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:///E:/InetPubC/Inetpub/wwwroot/dev.content.nipsco.nisource.net/bin/Testimonials.DLL.)
I have read all the pages I can find on this and see that the error is stating that the OpenAccess enhancer is not properly enhancing the persistant properties...but the example does not have any persistant properties.
I have tried many things from the forums but nothing seems to work. I have a DataConfig.config in the webapplication with a data connection called Sitefinity as is referenced in the example. I do not see any tables being created on the SQL server.
Any ideas of what to try next? I've sent off an email to try to get the 6.0 4100 SDK is it a version issue? Do I need to create the tables on the database before the exampe works, if so why is this not in the example? Do I need to mark the properties as persistant, but then again why is it not this way in the example?
So, I got the 6.0 version of the SDK from the sales team. Issue was resolved. So, SDK is not backwards compatable.
Hello,
To provide the solution to the problem for anyone encountering the same
The error message upon build related to "No metadata has been registered for class" is thrown because the OpenAccessEnhancer for the version of sitefinity the site is using (6.0 4100) was not found, the newer version of the OpenAccessEnhancer will not work for this case.
The OpenAccessEnhancer is supplied with each release of sitefinity SDK, however the sitefinity installer always download the latest version of sitefinity SDK.
To fix the problem edit .csproj file of the site and edit the highlighted entries
<
PropertyGroup
>
<
OpenAccessPath
>$(SolutionDir)..\..\..\..\..\Common\Dependencies\</
OpenAccessPath
>
</
PropertyGroup
>
<
Import
Condition
=
"Exists('$(OpenAccessPath)\OpenAccess.targets')"
Project
=
"$(OpenAccessPath)\OpenAccess.targets"
/>
<
OpenAccessPath>
tag.<
PropertyGroup
>
<
UseOpenAccessTargets
Condition
=
"'$(UseOpenAccessTargets)'==''"
>true</
UseOpenAccessTargets
>
<
OpenAccessPath
Condition
=
"'$(OpenAccessPath)'==''"
>c:\Program Files\Telerik\OpenAccess ORM</
OpenAccessPath
>
<
EnhancerAssembly
Condition
=
"'$(EnhancerAssembly)'==''"
>enhancer.exe</
EnhancerAssembly
>
<
ValidateMapping
Condition
=
"'$(ValidateMapping)'==''"
>false</
ValidateMapping
>