Asp design time error (An error was encountered while obtainining the Persistent types defined in the solution.Please build the projects in the solution and try again.)

4 posts, 0 answers
  1. Gábor
    Gábor avatar
    10 posts
    Member since:
    Nov 2010

    Posted 03 Nov 2010 Link to this post

    Hey people,

    I get the following error message in my task list in visual studio, when i try to use my telerik open acces datasources with any of the controls:
    An error was encountered while obtainining the Persistent types defined in the solution.Please build the projects in the solution and try again.
      
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid.
       at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags)
       at EnvDTE.Project.get_Object()
       at Telerik.OpenAccess.Sdk.Addin.Model.VAProject.IsWebProject()
       at Telerik.OpenAccess.Sdk.Addin.Model.VAProject.GetProjectItemExtension()
       at Telerik.OpenAccess.Sdk.Addin.Model.VASolution.RefillProjectCache()
       at Telerik.OpenAccess.Sdk.Addin.Model.VASolution.SolutionOpened()
       at Telerik.OpenAccess.Sdk.Addin.Model.VASolution..ctor(BaseAddin addin, _DTE dte)
       at Telerik.OpenAccess.Sdk.Addin.Model.VASolution.GetSolution(_DTE applicationObject)
       at Telerik.OpenAccess.Sdk.Addin.Core.DesignTimeHelper.GetHelperClassNamesFromWebSite()
       at Telerik.OpenAccess.Sdk.Addin.Core.DesignTimeHelper.DoWorkInAnotherDomain()
       at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
       at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
       at Telerik.OpenAccess.Sdk.Addin.Core.DesignTimeHelper.Initialize()
       at Telerik.OpenAccess.Sdk.Addin.Core.DesignTimeHelper.GetProxyTypes()
       at Telerik.OpenAccess.Sdk.Addin.API.RuntimeSupport.GetProxyTypes()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Telerik.OpenAccess.RT.PersistentClassesProvider.ObtainTypes()
       at Telerik.OpenAccess.RT.PersistentClassesProvider.GetClassesSorted()
       at Telerik.OpenAccess.Sdk.Addin.Design.PersclassTypeConverter.GetPersistentClasses()

    The ascx file where I get this error:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Functions.ascx.cs" Inherits="Xapt.AgilePoint.UI.Microsite.UserControls.Functions" %>
    <%@ Register Assembly="Telerik.OpenAccess.Web" Namespace="Telerik.OpenAccess" TagPrefix="telerik" %>
    <%@ Register Assembly="Xapt.General.Web" Namespace="Xapt.General.Web.UI" TagPrefix="xapt" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="Telerik.OpenAccess.Web" Namespace="Telerik.OpenAccess" TagPrefix="telerik" %>
      
    <div class="mediumCenter">
        <telerik:OpenAccessDataSource ID="SiteFunctions" runat="server" EnableDelete="False"
                EnableInsert="False" EnableUpdate="False" 
                ObjectContextProvider="Xapt.AgilePoint.Data.SiteContextModel.SiteEntityDiagrams, Xapt.AgilePoint.Data.SiteContextModel"
                TypeName="Xapt.AgilePoint.Data.SiteContextModel.SiteFunction" AutoGenerateWhereClause="True">
        </telerik:OpenAccessDataSource>
        <telerik:RadGrid ID="FunctionsGrid" runat="server" AutoGenerateColumns="False" 
            GridLines="None" oneditcommand="FunctionsGrid_EditCommand" OnInsertCommand="FunctionsGrid_InsertCommand" DataSourceID="SiteFunctions" >
            <MasterTableView CommandItemDisplay="Bottom" DataKeyNames="FunctionId"  >
            <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <Columns >
                    <telerik:GridBoundColumn HeaderText="FunctionId" 
                        UniqueName="columnFunctionId" DataField="FunctionId" Visible="false">
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="FunctionName" 
                        UniqueName="columnFunctionName" Resizable="true" DataField="Name" 
                        ColumnEditorID="GridTextBoxColumnEditor1">
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn HeaderText=""  UniqueName="EditCommandColumn" ButtonType="ImageButton">
                        <HeaderStyle Width="15%" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </telerik:GridEditCommandColumn>
                </Columns>
                <EditFormSettings ColumnNumber="1" >
                    <FormMainTableStyle Width="100%" />
                    <EditColumn ButtonType="ImageButton"/>
                    <FormTableButtonRowStyle HorizontalAlign="Right" />
                </EditFormSettings>  
            </MasterTableView>
        </telerik:RadGrid>
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1"  runat="server" TextBoxStyle-Width="200px" />
    </div>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="True" 
        Title="Test" Behavior="Default" InitialBehavior="None">
    </telerik:RadWindowManager>
    <telerik:RadWindow ID="RadWindowEditFunction" runat="server" Width="900" Height="500" Modal="true" VisibleOnPageLoad="false" OnClientClose="Window_OnClientClose">
    </telerik:RadWindow>

    My OpenAccess version is: 2010.2.804.5
    Any ideas what could be the problem?

    Regards,

    Gabor Varga
    Xapt Hungary Ltd.
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 08 Nov 2010 Link to this post

    Hello Gábor,

    It seems that the OpenAccessDataSource control is unable to obtain the needed persistent capable class.
    Could you please rebuild the project which contains you data access layer? If that does not help, we will have to ask you for your application in order to investigate the problem on our side.
    We are looking forward to your reply.

    All the best,
    Damyan Bogoev
    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. DevCraft banner
  4. Gábor
    Gábor avatar
    10 posts
    Member since:
    Nov 2010

    Posted 26 Nov 2010 Link to this post

    Hi Damyan,

    The rebuild did not help when I experienced this problem.

    Since that time I moved all the project to a new solution and that resolved the probled partly.
    The other problematic part is that there is a database project in the solution which contains only one ms-sql script.

    Once I unloaded that project that solved the problem permanently.

    If you still believe that u need the problematic source code, please let me know, and I can upload it.

    Regards,

    Gabor

    Xapt Ltd.
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 26 Nov 2010 Link to this post

    Hello Gábor,

    I am glad to see that you managed to resolve the problem.
    If any other questions arise, please feel free to contact us back.

    Kind regards,
    Damyan Bogoev
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Back to Top