This is a migrated thread and some comments may be shown as answers.

OpenAccess with Telerik MVC another problem

1 Answer 409 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michał
Top achievements
Rank 1
Michał asked on 18 Mar 2010, 05:11 PM
Hello,

I try to use OpenAccess with Telerik MVC Grid. I create View based on "Telerik MVC Samples" samples:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CustomerDto>>" %> 
(...)  
<%= Html.Telerik().Grid(Model)  
        .Name("Grid")   
        .Columns(columns =>   
        {   
            columns.Bound(c => c.Id).Width(100);  
            columns.Bound(c => c.Fax).Width(200);  
            columns.Bound(c => c.Phone);  
            columns.Bound(o => o.CreateDate).Format("{0:MM/dd/yyyy}").Width(120);  
        })   
%> 
(...) 
When CustomerDto is OpenAccess persistent class. And in controller I put:
IObjectScope scope = ObjectScopeProvider.GetPerRequestScope();  
IQueryable<CustomerDto> customers = scope.Extent<CustomerDto>();  
 
return View(new GridModel(customers));  
 
I reference Telerik.OpenAcess.dll and Telerik.OpenAccess.35.Extensions.dll and after run application I see:
Compiler Error Message: CS0012: The type 'Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Telerik.OpenAccess, Version=2010.1.310.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342'.  
Line 164:      
Line 165:    [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]  
Line 166:    public class views_home_about_aspx : System.Web.Mvc.ViewPage<IEnumerable<CustomerDto>>, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {  
Line 167:          
Line 168:        private static bool @__initialized; 

1 Answer, 1 is accepted

Sort by
0
Michał
Top achievements
Rank 1
answered on 18 Mar 2010, 06:43 PM
I found a solution. I need to put:
<add assembly="Telerik.OpenAccess, Version=2010.1.312.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" /> 

In web.config:
<configuration> 
  <system.web> 
    <compilation debug="true">  
      <assemblies> 
        <add assembly="Telerik.OpenAccess, Version=2010.1.312.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" /> 
        (...) 
Tags
Integration with other products
Asked by
Michał
Top achievements
Rank 1
Answers by
Michał
Top achievements
Rank 1
Share this question
or