Error when building a project with a class that inherits from OpenAccessDataContext

6 posts, 0 answers
  1. Alexandre
    Alexandre avatar
    12 posts
    Member since:
    May 2009

    Posted 17 Sep 2009 Link to this post

     

    Hi I have a class that inherits from  OpenAccessDataContex, but when I try to build the solution I get this errors.

    C:\xxxFramework.WPF\DataContextBase.Desktop.cs(77,18): error CS0012: The type 'System.Data.Services.IUpdatable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    c:\xxxFramework\_ExternalComponents\Framework\WPF\Telerik.OpenAccess.40.dll: (Related file)

    C:\xxxFramework.WPF\DataContextBase.Desktop.cs(77,18): error CS0012: The type 'System.Data.Services.IExpandProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    c:\xxxFramework\_ExternalComponents\Framework\WPF\Telerik.OpenAccess.40.dll: (Related file)

    My Project has right System.Data.Services.dll reference, is from .NET Framework 3.5 SP1 and I checked an is the version that Telerik.OpenAccess.40.dll is requesting.

    Any ideas why i'm getting this errors?
    I needed to deliver this today and can't build it cause of this, is driving me crazy.

    TIA
    My class looks like this.

     

     

     

    using System;  
    using System.Collections;  
    using System.Collections.Generic;  
    using System.Data.Services;  
    using System.Diagnostics;  
    using System.Linq;  
    using System.Globalization;  
    using System.Reflection;  
    using Telerik.OpenAccess;  
    using Telerik.OpenAccess.Helper;  
     
    namespace MyNamespace  
    {  
        public class DataContextBase : OpenAccessDataContext  
        {  
            public DataContextBase() : base() { }  
            public DataContextBase(IObjectScope scope) : base(scope) { }  
            public DataContextBase(IObjectScope scope, bool shouldDispose) : base(scope,shouldDispose) { }  
     
            public void OnEntityChange(BusinessEntityBase entity, UpdateOperations uo, string entityDisplayName)  
            {  
                if (uo == UpdateOperations.Add || uo == UpdateOperations.Change)  
                {  
                    if (!entity.IsValid())  
                    {  
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();  
                        sb.AppendLine(string.Format(CultureInfo.CurrentCulture, Properties.Resources.EntityNameError));  
                        foreach (var item in entity.ValidatationErrors)  
                        {  
                            sb.AppendLine(item.Value.BrokenRule.RuleEventArgs.BrokenRuleDescription);  
                        }  
                        throw new DataServiceException(400, sb.ToString());  
                    }  
                }  
            }  
        }  
    }  
     

     

     

     

     

     

  2. Alexandre
    Alexandre avatar
    12 posts
    Member since:
    May 2009

    Posted 18 Sep 2009 Link to this post

    Anyone from telerik can't give me an answer of what is going on?
    I even tried to not inherit just declare a variable as OpenAccessDataContex and when building it gives the same error.
    HELP!!!
  3. DevCraft banner
  4. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 18 Sep 2009 Link to this post

    Hi Alexandre,
    I think you have to reference the System.Data.Services assembly in the project where you are using the OpenAccessDataContext as well. This should make the error go away.
    We will be polishing the behavior of our Telerik.OpenAccess.40.dll  as it is efficient to be used in Ado.Net data services projects only right now. Please let me know if the problem is solved or you require further assistance.

    Best wishes,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Alexandre
    Alexandre avatar
    12 posts
    Member since:
    May 2009

    Posted 18 Sep 2009 Link to this post

    Hi Dimitar as I said on my 1st post the project have a reference to the C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.Services.dll and I double check and the file version is 3.5.30729.196 so that is the version of .net framework 3.5, so that was why I was why can't I build my project and keep getting that error.

    TIA
  6. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 21 Sep 2009 Link to this post

    Hello Alexandre,
    Just checked and what we are actually referring is not System.Data.Services.dll, but Microsoft.Data.Services.dll. This is required because of the support that is provided to Ado.Net data services v.1.5 (you can find more and how to upgrade here). Because Ado.Net Data Services is still in CTP mode (an official release is expected to be a part of .NET 4.0) we are targeting the latest releases from MS and we provided bindings to the latest of them. I would like to know whether such an upgrade works for you, and if not I will need to think of a way to provide you with a version that has the older bindings.



    All the best,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Alexandre
    Alexandre avatar
    12 posts
    Member since:
    May 2009

    Posted 21 Sep 2009 Link to this post

    Hi Dimitar.
    Thanks for the reply I dind't even saw that was Microsoft.Data .Services, I saw on the documentation that it needed .net3.5 sp1 ado.net data services, and was reading the error messages but was always thinking in System.Data.Services.
    That will not work for me, this is a Framework i'm developing and I don't want to add CTP build to it, so what I did was remove the telerik assembly and use my own implementation of a dataservice.
Back to Top
DevCraft banner