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

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

5 Answers 138 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexandre
Top achievements
Rank 1
Alexandre asked on 17 Sep 2009, 01:41 PM

 

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());  
                }  
            }  
        }  
    }  
}  
 

 

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Alexandre
Top achievements
Rank 1
answered on 18 Sep 2009, 01:49 PM
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!!!
0
Dimitar Kapitanov
Telerik team
answered on 18 Sep 2009, 02:11 PM
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.
0
Alexandre
Top achievements
Rank 1
answered on 18 Sep 2009, 02:19 PM
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
0
Dimitar Kapitanov
Telerik team
answered on 21 Sep 2009, 08:02 AM
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.
0
Alexandre
Top achievements
Rank 1
answered on 21 Sep 2009, 09:50 AM
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.
Tags
Development (API, general questions)
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Alexandre
Top achievements
Rank 1
Dimitar Kapitanov
Telerik team
Share this question
or