No metadata has been registered for class LocationsModule.Mo

Posted by Community Admin on 04-Aug-2018 21:30

No metadata has been registered for class LocationsModule.Model.LocationItem.

All Replies

Posted by Community Admin on 26-Jul-2011 00:00

Hi,
I tried to develop a Locations module provided here: http://www.sitefinity.com/blogs/joshmorales/posts/11-07-07/creating_sitefinity_4_content_modules_part_1_project_preparation_and_hello_world.aspx
I followed all 5 steps mentioned in that series including enhancing the project for OpenAccess specified here: http://www.telerik.com/help/openaccess-orm/fluent-mapping-getting-started-fluent-mapping-api.html.

I am still getting the saying 'No metadata has been registered for class LocationsModule.Model.LocationItem.(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:/Users/user/Desktop/ProjectManager_4.1.1533.0__E-Commerce_Preview/Projects/ECommTest/bin/LocationsModule.DLL.)'

Is there anything else that I am missing for creating this Locations module? I searched on the forums but didn't find the solution.

Posted by Community Admin on 29-Jul-2011 00:00

Hi Sachin,

To enhance it review the .csproj file of the module. It should look like this.

<UserProperties OpenAccess_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>
  <Import Condition="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 29-Jul-2011 00:00

I am running into the same issues and the above did not fix anything.  Any other insights?  Did you ever resolve this issue?

Posted by Community Admin on 29-Jul-2011 00:00

Chris,

It fixed this problem. You need to add <VisualStudio> <ProjectExtensions> before the code mentioned above and change the OpenAccessPath to the directory where you installed OpenAccess. Now I am working on the error “error parsing the template” when I added the front end control to the page even though I have registered it 's virtual path in Global.asax.

Posted by Community Admin on 29-Jul-2011 00:00

Will you please give me an example of your .csproj file.  I changed the OpenAccessPath to my local installed directory, but I still get the error.  I also get show an error (Red Underlined) of the <OpenAccessPath> is that normal?  I appreciate the help, I am very new to Sitefinity, like 2 days.

Posted by Community Admin on 29-Jul-2011 00:00

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>C0006634-E36A-45D7-8931-B8FCD0350665</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>LocationsModule</RootNamespace>
    <AssemblyName>LocationsModule</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.configuration" />
    <Reference Include="System.Core" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Web" />
    <Reference Include="System.Web.Extensions" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="Telerik.OpenAccess">
      <HintPath>..\bin\Telerik.OpenAccess.dll</HintPath>
    </Reference>
    <Reference Include="Telerik.OpenAccess.35.Extensions">
      <HintPath>..\bin\Telerik.OpenAccess.35.Extensions.dll</HintPath>
    </Reference>
    <Reference Include="Telerik.Sitefinity">
      <HintPath>..\bin\Telerik.Sitefinity.dll</HintPath>
    </Reference>
    <Reference Include="Telerik.Sitefinity.Model">
      <HintPath>..\bin\Telerik.Sitefinity.Model.dll</HintPath>
    </Reference>
    <Reference Include="Telerik.Web.UI">
      <HintPath>..\bin\Telerik.Web.UI.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Configuration\LocationsConfig.cs" />
    <Compile Include="Data\LocationsManager.cs" />
    <Compile Include="Data\OpenAccess\LocationsFluentMapping.cs" />
    <Compile Include="Data\OpenAccess\LocationsFluentMetaDataSource.cs" />
    <Compile Include="Data\OpenAccess\OpenAccessLocationsDataProvider.cs" />
    <Compile Include="LocationsModule.cs" />
    <Compile Include="Model\LocationItem.cs" />
    <Compile Include="Model\LocationItemUrlData.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Web\Services\Data\LocationItemViewModel.cs" />
    <Compile Include="Web\Services\LocationsBackendService.cs" />
    <Compile Include="Web\UI\LocationsDefinitions.cs" />
    <Compile Include="Web\UI\Public\Designers\LocationsViewDesigner.cs" />
    <Compile Include="Web\UI\Public\DetailsView.cs" />
    <Compile Include="Web\UI\Public\LocationsView.cs" />
    <Compile Include="Web\UI\Public\MasterListView.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="obj\Debug\TempPE\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="bin\Debug\AjaxControlToolkit.dll" />
    <Content Include="bin\Debug\DirectShowLib-2005.dll" />
    <Content Include="bin\Debug\DocumentFormat.OpenXml.dll" />
    <Content Include="bin\Debug\LocationsModule.dll" />
    <Content Include="bin\Debug\LocationsModule.pdb" />
    <Content Include="bin\Debug\Microsoft.Practices.ServiceLocation.dll" />
    <Content Include="bin\Debug\Microsoft.WindowsAzure.Diagnostics.dll" />
    <Content Include="bin\Debug\Microsoft.WindowsAzure.ServiceRuntime.dll" />
    <Content Include="bin\Debug\Microsoft.WindowsAzure.StorageClient.dll" />
    <Content Include="bin\Debug\Telerik.OpenAccess.35.Extensions.dll" />
    <Content Include="bin\Debug\Telerik.OpenAccess.dll" />
    <Content Include="bin\Debug\Telerik.OpenAccess.Web.dll" />
    <Content Include="bin\Debug\Telerik.Sitefinity.dll" />
    <Content Include="bin\Debug\Telerik.Sitefinity.Model.dll" />
    <Content Include="bin\Debug\Telerik.Sitefinity.Utilities.dll" />
    <Content Include="bin\Debug\Telerik.Web.UI.dll" />
    <Content Include="bin\Debug\Telerik.Windows.RadUploadHandler.dll" />
    <Content Include="bin\Debug\Twitterizer2.dll" />
    <Content Include="obj\Debug\LocationsModule.csproj.FileListAbsolute.txt" />
    <Content Include="obj\Debug\LocationsModule.dll" />
    <Content Include="obj\Debug\LocationsModule.pdb" />
    <EmbeddedResource Include="Web\UI\Public\Resources\DetailsView.ascx">
      <SubType>ASPXCodeBehind</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="Web\UI\Public\Resources\MasterListView.ascx" />
  </ItemGroup>
  <ItemGroup>
    <None Include="obj\Debug\build.force" />
    <None Include="obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties OpenAccess_EnhancementOutputLevel="1" OpenAccess_UpdateDatabase="False" OpenAccess_Enhancing="True" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_ConfigFile="App.config" />
    </VisualStudio>
  </ProjectExtensions>
  <PropertyGroup>
    <PostBuildEvent>
    </PostBuildEvent>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>
  <PropertyGroup>
    <OpenAccessPath>C:\Program Files\telerik\OpenAccess ORM\ProductSdk\Content\Common\Dependencies</OpenAccessPath>
  </PropertyGroup>
  <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

Posted by Community Admin on 29-Jul-2011 00:00

Mine looks close to yours however for the OpenAccessPath I dont have the "\ProductSdk\Content\Common\Dependencies" it ends up being "C:\Program Files\Telerik\OpenAccess ORM"  I have a folder called sdk and that looks to have the OpenAccess.targets file that it is looking for.  Could this be a version issue?  I am using 4.1.1501.0.  I am stumped here.

<ProjectExtensions>
    <VisualStudio>
      <UserProperties OpenAccess_EnhancementOutputLevel="1" OpenAccess_UpdateDatabase="False" 
                      OpenAccess_Enhancing="True" OpenAccess_ConnectionId="DatabaseConnection1" 
                      OpenAccess_ConfigFile="App.config" />
    </VisualStudio>
  </ProjectExtensions>
  <PropertyGroup>
    <PostBuildEvent>
    </PostBuildEvent>
    <PreBuildEvent>
    </PreBuildEvent>
  </PropertyGroup>
  <PropertyGroup>
    <OpenAccessPath>C:\Program Files\Telerik\OpenAccess ORM</OpenAccessPath>
  </PropertyGroup>
  <Import Condition="Exists('$(OpenAccessPath)\OpenAccess.targets')" Project="$(OpenAccessPath)\OpenAccess.targets" />

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

Hi Chris,

Please check this thread that explains some of the reasons for the error "No metadata has been registered for class classname"

PropertyGroup should point to the location where you have OpenAccess.targets which reference the location of enhancer.exe and VEnhance which should be in the same folder.

Best wishes,
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 01-Aug-2011 00:00

I installed the Sitefinity SDK and pointed the OpenAccessPath to the new installed location for the Enhancer.  That appeared to work.

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

Sachin,

Did you figure out the "Error Parsing Template" because now I am getting the same error.

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

Hello Chris,

Can you tell me where did you get "Error Parsing Template" and what changes have you made before the error occurred. The usual cause is when modifying the frontend widget of the module which uses widget template. You can make changes to this widget template and adding something new at the wrong place results in "Error Parsing Template". Edit the widget template and restore it to defaults to fix the problem.

Regards,
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 20-Jan-2012 00:00

Stanislav - thanks for the tip!

This thread is closed