Matt Matt - 10 months ago 61
ASP.NET (C#) Question

The type or namespace name 'DataServiceQuerySingle' does not exist

I got the latest version of oData from Nuget yesterday because I was having trouble adding a second Odata client to a project of mine. If both client codes are in the same level of the project, same starting namespace, there is a problem. To fix this problem I recreated the second client in another folder/namespace. Now the problem is this error:

The type or namespace name 'DataServiceQuerySingle' does not exist in the namespace 'Microsoft.OData.Client' (are you missing an assembly reference?)

Client is generated by means of OData Client item template also downloaded from NuGet. A T4 template builds all the code from an EDMX xml file I got from the OData service in question. In my references the OData libraries are version 6.4, but Nuget says I have the latest - 6.14. To try to be sure I had the right version I completely uninstalled odata from my project and re-installed it from NuGet.

How can I get my new client to be built? I'm not touching the original Odata client because that one still works as far as I can tell.

Answer Source

I'm not sure what to do about this, still. I fixed some of my problems by removing libraries that someone had actually manually included in the solution and just having the nuget packages. I think I finally just had to manually call the odata service using HttpClient. SO overally my solution works but I'm not happy about it.