Adding Open Access to Sitefinity

Thread is closed for posting
3 posts, 0 answers
  1. Gabe Sumner
    Gabe Sumner avatar
    10 posts
    Member since:
    Sep 2007

    Posted 22 Nov 2008 Link to this post

    I'm attempting to use Open Access inside of a Sitefinity web site.  I have done the following:

    I created a ~/App_Code/TestPersist.cs file with the following code:

    /// <summary>  
    /// Summary description for TestPersist  
    /// </summary>  
    public class TestPersist  
        public string FirstName;  
        public string LastName;  
        public TestPersist()  

    I then added the following section to my ~/web.config file:

      <openaccess xmlns="">  
          <reference assemblyName="App_Code" /> 
          <connection id="DatabaseConnection1">  
          <backendconfiguration id="mssqlConfiguration" backend="mssql">  
        <mappings current="mssqlMapping">  
          <mapping id="mssqlMapping" /> 

    I then attempted to execute the following code:

        protected void Page_Load(object sender, EventArgs e)  
            TestPersist hello = new TestPersist();  
            hello.FirstName = "Gabe";  
            hello.LastName = "Sumner";  
            IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope();  

    I get the following error:

    Telerik.OpenAccess: No enhanced assembly has been found for meta-data construction. This may be caused by a missing app.config file (use app.config as embedded resource then) or by an insufficient references section in the configuration file (add the referenced enhanced assemblies there too) or by a wrong enhancement setting; please check your configuration.

    I have a reference added for "App_Code".  This is the assembly where (I think) my persistent classes reside.  I'm sure I'm doing something stupid.  Any advice?

    Gabe Sumner
  2. Jan Blessenohl
    Jan Blessenohl avatar
    707 posts

    Posted 24 Nov 2008 Link to this post

    Hi Gabe Sumner,

    The problem is that OpenAccess needs to enhance the compiled assembly to add lazy loading and change tracking to the model. This is a post build step that is only available for projects with a real assembly as output. This is not the case with your web project.

    What you have to do id to add a class library project that contains the persistent classes and reference this from your web project.

    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Gabe Sumner
    Gabe Sumner avatar
    10 posts
    Member since:
    Sep 2007

    Posted 12 Dec 2008 Link to this post

Back to Top