+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Application module extnt error

Application module extnt error

8 posts, 0 answered
  1. mstoffel
    mstoffel avatar
    27 posts
    Registered:
    13 Jul 2005
    11 Apr 2011
    Link to this post
    Hi,

    I create a new application module with the template (Intermediate Module Template) and the help of the tutorial (jobapplication intermediate). Jobapplication is running by me but not my new application module.

    I receive this error:

    Exception Details: Telerik.OpenAccess.Exceptions.QueryException: No class found for extent "extnt".
    Original Query: DEFINE EXTENT extnt FOR CompanyCRM.Model.CompanyCRMModel; SELECT * FROM extnt AS t1  WHERE t1.appName =  $1

    Can someone help me?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    11 Apr 2011
    Link to this post
    Hello michel,

    Check your module references the OpenAccess VEnhance.exe which enhances your persistent classes. This is described here.
    If you take a look at our samples we use VEnhance.exe, because OpenAccess “enhances” assemblies as part of the build process.

    You should open the csproj file and there is the following declaration which specifies the path to the enhancer

    <Target Name="EnhanceAssembly" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
        <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).notenhanced" />
        <Copy SourceFiles="$(PdbFile)" DestinationFiles="$(PdbFile).notenhanced" ContinueOnError="true" />
        <Message Text="$(TargetDir)" Importance="high" />
        <Message Text="Solution = $(SolutionDir)" Importance="high" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command="&quot;$(LibrariesDir)VEnhance.exe&quot; -verboseMode:2 &quot;-config:$(ProjectDir)App.config&quot; -signAssembly &quot;-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)&quot; &quot;-assembly:$(TargetPath)&quot;" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command="&quot;$(LibrariesDir)VEnhance.exe&quot; -verboseMode:2 &quot;-config:$(ProjectDir)App.config&quot; &quot;-assembly:$(TargetPath)&quot;" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
        <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
        <Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
      </Target>

    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?

    OA provider

           private static Assembly[] peristentAssemblies;

           static OpenAccessProvider()
            {
                peristentAssemblies = new Assembly[] { typeof(MyCustomModel).Assembly };
            }


    public Assembly[] GetPersistentAssemblies()
            {
                return peristentAssemblies;
            }


    so you have a class

    [Persistent(IdentityField = "contentId")]
    public class MyCustomModel : Content
    ...



    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. mstoffel
    mstoffel avatar
    27 posts
    Registered:
    13 Jul 2005
    11 Apr 2011
    Link to this post
    Hello Ivan,

    I check my csproj file and the only difference was this lines:

    Your csproj:

    <Message Text="$(TargetDir)" Importance="high" />
    <
    Message Text="Solution = $(SolutionDir)" Importance="high" />
    <
    Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" -signAssembly "-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
    <
    Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'==''" />

    you have "SolutionDir" and for me it was "TargetDir" and 2 lines with tag "Message"

    My csproj:

    <Target Name="EnhanceAssembly" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
      <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).notenhanced" />
      <Copy SourceFiles="$(PdbFile)" DestinationFiles="$(PdbFile).notenhanced" ContinueOnError="true" />
      <Exec IgnoreExitCode="false" WorkingDirectory="$(TargetDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" -signAssembly "-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
      <Exec IgnoreExitCode="false" WorkingDirectory="$(TargetDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
      <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
      <Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
    </Target>

    and here my "simple" CompanyCRM model:

    using Telerik.OpenAccess;
    using Telerik.Sitefinity;
    using Telerik.Sitefinity.GenericContent.Model;
     
    namespace CompanyCRM.Model
    {
        [ManagerType("CompanyCRM.CompanyCRMManager, CompanyCRM")]
        [Persistent(IdentityField = "contentId")]
        public class CompanyCRMModel : Content
        {
            public override bool SupportsContentLifecycle
            {
                get
                {
                    return false;
                }
            }
     
            [FieldAlias("companyName")]
            public string CompanyName
            {
                get
                {
                    return this.companyName;
                }
                set
                {
                    this.companyName = value;
                }
            }
     
            [FieldAlias("companyAddress")]
            public string CompanyAddress
            {
                get
                {
                    return this.companyAddress;
                }
                set
                {
                    this.companyAddress = value;
                }
            }
     
            private string companyName;
            private string companyAddress;
        }
    }

    I change my csproj with "SolutionDir " and the 2 lines with the tag message without success...

    I receive still the same message :/ 

    No class found for extent "extnt".


    Regards,
    /Michel


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    11 Apr 2011
    Link to this post
    Hello,

    Have you implemented GetPersistentAssemblies?  It is also possible that you are not referencing VEnhancer.exe correctly.


    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. mstoffel
    mstoffel avatar
    27 posts
    Registered:
    13 Jul 2005
    11 Apr 2011
    Link to this post
    I have now implemented the "GetPersistentAssemblies" but I recieve same error message :/

    Here my OpenAccessCompanyCRMDataProvider.cs

    using System;
    using System.Linq;
    using System.Reflection;
    using CompanyCRM.Model;
    using Telerik.OpenAccess;
    using Telerik.Sitefinity.Data;
    using Telerik.Sitefinity.Data.Linq;
    using Telerik.Sitefinity.Model;
    using Telerik.Sitefinity.Modules.GenericContent.Data;
    using Telerik.Sitefinity.Security;
     
    namespace CompanyCRM.Data
    {
        /// <summary>
        /// A CompanyCRMs provider implemented using OpenAccess
        /// </summary>
        [ContentProviderDecorator(typeof(OpenAccessContentDecorator))]
        public class OpenAccessCompanyCRMDataProvider : CompanyCRMDataProviderBase, IOpenAccessDataProvider
        {
            #region IOpenAccessDataProvider Members
     
            public Database Database
            {
                get;
                set;
            }
     
            public bool UseImplicitTransactions
            {
                get
                {
                    return true;
                }
            }
     
     
           private static Assembly[] peristentAssemblies;
     
           static OpenAccessCompanyCRMDataProvider()
            {
                peristentAssemblies = new Assembly[] { typeof(CompanyCRMModel).Assembly };
            }
     
     
            public Assembly[] GetPersistentAssemblies()
            {
                //return new[] { typeof(CompanyCRMModel).Assembly };
                return peristentAssemblies;
            }
     
            #endregion
     
            public override CompanyCRMModel CreateCompanyCRMModel()
            {
                return this.CreateCompanyCRMModel(Guid.NewGuid());
            }
     
            public override CompanyCRMModel CreateCompanyCRMModel(Guid id)
            {
                var dateValue = DateTime.UtcNow;
     
                var item = new CompanyCRMModel()
                {
                    Id = id,
                    ApplicationName = this.ApplicationName,
                    Owner = SecurityManager.GetCurrentUserId(),
                    DateCreated = dateValue,
                    PublicationDate = dateValue
                };
     
                ((IDataItem)item).Provider = this;
     
                if (id != Guid.Empty)
                {
                    this.GetScope().Add(item);
                }
     
                return item;
            }
     
            public override IQueryable<CompanyCRMModel> GetCompanyCRMModels()
            {
                var appName = this.ApplicationName;
     
                var query =
                    SitefinityQuery
                    .Get<CompanyCRMModel>(this, MethodBase.GetCurrentMethod())
                    .Where(b => b.ApplicationName == appName);
     
                return query;
            }
     
            public override CompanyCRMModel GetCompanyCRMModel(Guid id)
            {
                if (id == Guid.Empty)
                    throw new ArgumentNullException("id");
     
                var item = this.GetScope().GetItemById<CompanyCRMModel>(id.ToString());
                ((IDataItem)item).Provider = this;
                return item;
            }
     
            public override void DeleteCompanyCRMModel(CompanyCRMModel application)
            {
                var scope = this.GetScope();
                if (scope != null)
                {
                    scope.Remove(application);
                }
            }
     
            public TransactionMode TransactionConcurrency
            {
                get {
                    //return TransactionMode.PESSIMISTIC_EXPLICIT;
                   return TransactionMode.OPTIMISTIC_NO_LOST_UPDATES;
                }
            }
        }
    }
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    12 Apr 2011
    Link to this post
    Hello michel ,

    Most probably the problem comes from VEnhance.exe and the way that you are referencing in the cs project file. I do not see what else could case this error than what I already wrote above.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  7. mstoffel
    mstoffel avatar
    27 posts
    Registered:
    13 Jul 2005
    12 Apr 2011
    Link to this post
    Hi Ivan,

    I don't know here the source code of the project module and the path of VEnhance.exe is correct into the registry (please see png attachment).

    Perhaps I would have more chance to build a module with the new version 4.1 I hope so ... :/

    <?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>{007E8B10-66F0-4B50-B5F6-EF3C0143FE12}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>CompanyCRM</RootNamespace>
        <AssemblyName>CompanyCRM</AssemblyName>
        <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <TargetFrameworkProfile />
        <LibrariesDir>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Telerik\SitefinitySDK\@LibrariesDir)</LibrariesDir>
        <PdbFile>$(OutDir)\$(AssemblyName).pdb</PdbFile>
        <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
        <PrepareForRunDependsOn>
          $(PrepareForRunDependsOn);
          EnhanceAssembly;
          <!-- PeVerify --></PrepareForRunDependsOn>
      </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="Mono.Cecil">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Mono.Cecil.dll</HintPath>
        </Reference>
        <Reference Include="Mono.Cecil.Pdb">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Mono.Cecil.Pdb.dll</HintPath>
        </Reference>
        <Reference Include="System" />
        <Reference Include="System.configuration" />
        <Reference Include="System.Core" />
        <Reference Include="System.Runtime.Serialization" />
        <Reference Include="System.Web" />
        <Reference Include="System.Web.Extensions" />
        <Reference Include="System.Xml.Linq" />
        <Reference Include="System.Data.DataSetExtensions" />
        <Reference Include="System.Data" />
        <Reference Include="System.Xml" />
        <Reference Include="Telerik.OpenAccess">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Telerik.OpenAccess.dll</HintPath>
        </Reference>
        <Reference Include="Telerik.OpenAccess.35.Extensions">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Telerik.OpenAccess.35.Extensions.dll</HintPath>
        </Reference>
        <Reference Include="Telerik.Sitefinity">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Telerik.Sitefinity.dll</HintPath>
        </Reference>
        <Reference Include="Telerik.Sitefinity.Model">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Telerik.Sitefinity.Model.dll</HintPath>
        </Reference>
        <Reference Include="Telerik.Web.UI">
          <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Telerik\Sitefinity 4.0\Libraries\Telerik.Web.UI.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Configuration\CompanyCRMConfig.cs" />
        <Compile Include="Localization\CompanyCRMResources.cs" />
        <Compile Include="Data\OpenAccessCompanyCRMDataProvider.cs" />
        <Compile Include="CompanyCRMDataProviderBase.cs" />
        <Compile Include="CompanyCRMManager.cs" />
        <Compile Include="CompanyCRMModule.cs" />
        <Compile Include="Model\CompanyCRMModel.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
        <Compile Include="PublicControls\CompanyCRMedit.cs" />
        <Compile Include="PublicControls\CompanyCRMoverview.cs" />
        <EmbeddedResource Include="Resources\Views\CompanyCRMoverview.ascx" />
        <EmbeddedResource Include="Resources\Views\CompanyCRMedit.ascx">
          <SubType>ASPXCodeBehind</SubType>
        </EmbeddedResource>
      </ItemGroup>
      <ItemGroup>
        <None Include="App.config" />
      </ItemGroup>
      <ItemGroup />
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
      -->
      <!-- Telerik OpenAccess enhancement -->
      <ProjectExtensions>
        <VisualStudio>
          <UserProperties OpenAccess_ConfigFile="App.config" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_Enhancing="False" OpenAccess_UpdateDatabase="False" OpenAccess_EnhancementOutputLevel="1" />
        </VisualStudio>
      </ProjectExtensions>
      <Target Name="EnhanceAssembly" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
        <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).notenhanced" />
        <Copy SourceFiles="$(PdbFile)" DestinationFiles="$(PdbFile).notenhanced" ContinueOnError="true" />
        <Message Text="$(TargetDir)" Importance="high" />
        <Message Text="Solution = $(SolutionDir)" Importance="high" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" -signAssembly "-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
        <Exec IgnoreExitCode="false" WorkingDirectory="$(SolutionDir)" Command=""$(LibrariesDir)VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
        <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
        <Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
      </Target>
      <Target Name="PeVerify" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
        <GetFrameworkSdkPath>
          <Output TaskParameter="Path" PropertyName="SdkPath" />
        </GetFrameworkSdkPath>
        <Exec WorkingDirectory="$(SdkPath)bin" Command="peverify.exe /nologo "$(TargetPath)"" />
      </Target>
    </Project>
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Apr 2011
    Link to this post
    Hi michel stoffel,

    Can you please check your model class to see if you have marked all relative fields as persistent and provided the field alias attribute.

    All the best,
    Radoslav Georgiev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

8 posts, 0 answered