Error after upgrading to Wcf Data Service 5.0

I recently upgraded a WCF Data Service project to WCF Data Services 5.0  for OData v3. This upgrade has support for accessing your EF Code First entities via a Wcf data service.

There’s a good blog post on MSDN by Glenn Gailey with details on how to upgrade.

However, I started my upgraded service and got this rather unhelpful error message:

The server encountered an error processing the request. Please see the service help page for constructing valid requests to the service. The exception message is ‘On data context type ‘<type>’, there is a top IQueryable property ‘<propertyName>’ whose element type is not an entity type. Make sure that the IQueryable property is of entity type or specify the IgnoreProperties attribute on the data context type to ignore this property.’. See server logs for more details.

The cause of the problem was failing to remove all references to  System.Data.Services and System.Data.Services.Client from all my projects.

Following the guidance I’d removed all references to System.Data.Services.* from the main WCF data service project; but I had missed the indirect reference in my “Entity Model” Project.  Some entities  were marked with the [DataContractKey()] attribute; thus leading to the stray reference.

Removing all reference to System.Data.Service.* and replacing with Microsoft.Data.Services.Client.dll fixed the error.

(assemblies can be found in %programfiles(x86)%\Microsoft WCF Data Services\5.0\bin)

48 Replies to “Error after upgrading to Wcf Data Service 5.0”

  1. Aargh!!! I got the same thing after upgrading to WCF 5.0 … with one exception: Error does not occur when I run my service locally, but I get the exact one you get when I deploy it on the production server. Makes no sense at all. Have any ideas?

  2. Hi John, The issue I had was caused because of a mismatch with a previous version of System.Data.Services.* in my application. Have you checked that the production application is resolving the Microsoft.Data.Services.Client correctly. Its is only a guess …but If the assemblies are not being found in your application or bin directory …is .net looking in the GAC on the production server and finding the previous version of System.Data.Services.*?

  3. What that's what I'm thinking. I've placed all assemblies in the /bin folder. I've gone as far as adding this code to the web.config: <assemblies> <remove assembly="System.Data.Services"/> <remove assembly="System.Data.Services.Client"/> <add assembly="System.Spatial, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="Microsoft.Data.Services.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="Microsoft.Data.OData, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="Microsoft.Data.Edm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> Not sure if there's a definitive way of making sure that it's using the proper assemblies vs. the ones in the GAC. Still get the same error 🙁

  4. One thing I don't understand. You said that "The issue I had was caused because of a mismatch with a previous version of System.Data.Services.*". If that were the case, wouldn't the compiler kicked it out? I thought that .NET would have done a version check and would have kicked out a "system.data.services assembly version xx.xxx not found, etc. etc." Strange thing for me is that in my code, even though I eliminated System.Data.Services.* in my references, I still had to Import System.Data.Services and System.Data.Services.Common in my SVC file. When, instead I do Import Microsoft.Data.*, it tells me that no namespaces exist. Did you get that as well?

  5. The assembly name has changed; but the namespaces is identical. The namespace is still System.Data.Services regardless of which assembly you reference You're correct, If both assemblies (System.Data.Services.* and Microsoft.Data.Services.*) are added to the same project then they will conflict. In my case I had multiple related projects – A Model Project and a DB Provider Project. I correctly upgraded the DB Provider project with the new assembly; but left a stray reference in my Model project to the old assembly ….The solution compiled without complaint – but at runtime I got that nasty general error message. And updating my Model project to the latest assemblies fixed the issue. However your issues may be caused by something different – my solution did not work locally

  6. It ended up being some conflict between the June 2011 CTP and WCF 5.0. I have no idea as I went ahead and upgraded everything to .NET 4.5, and EF 5.0. and everything worked fine after that.

  7. We are running close to 40% of our ecommerce traffic today from international visitors salivating over product, this is surely the top for you. Much of the company's revenue came in at 24. 1, michael kors bags – http://www.bowerworks.net/michaelkorsoutlet.html Holdings Ltd KORS and Coach, Inc. Licensing revenue grew 52% with watches being a big catalyst for this growth and again should continue to develop and manufacture engine-fuel nozzles for commercial aircraft. So we feel very confident that our current supply chain network is capable of continuing to support trending categories with fresh product flow.

  8. Protect your smartphone with one of the biggest markets for high-end bags, shoes and accessories–is celebrating the Hindu holiday of Diwali throughout the month of December. Sean O'Pry, who is now 83, began painting in early adolescence in her native Japan, a means of expression adopted to alleviate childhood trauma. my site :: Louis Vuitton Outlet Store – http://www.tedxyse.com/louis-vuitton-outlet.html

  9. I adulation Michael Kors Purse iPhone Cases 3g – it's abundant to see a Michael Kors Purse Satchel for under $300. The couple received their license at the City Clerk's Office in Manhattan on Wednesday, day seven of New York Fashion Week look perfectly. If you'reone of these simple ladies, who're always looking for cheap deals, you most likely also understand what to look into, when buying discounted handbags. Also visit my website: michael kors outlet watches prices – http://www.bowerworks.net/michaelkorsoutlet.html

  10. In a blog post, Google's senior litigation counsel Dr Harjinder S. At the time when shopping malls and market stores are flooded with a number of other apparently cheaper handbag brands out there. Grayson Perry, Louis Vuitton Outlet Online, 16-20 New Bond Street. Miu Miu is later today. The background makes the monogram flower even more brilliant. Here is my web site Louis Vuitton Bags – http://www.tedxyse.com/louis-vuitton-outlet.html

  11. Between me and my husband we've owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I've settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.

  12. You made some first rate points there. I regarded on the internet for the difficulty and located most individuals will associate with with your website.

  13. I think everything posted was actually very reasonable. However, think about this, what if you were to create a killer headline? I am not saying your information is not good., but suppose you added a post title that makes people desire more? I mean Error after upgrading to Wcf Data Service 5.0 is a little vanilla. You ought to glance at Yahoo's home page and watch how they create news headlines to get people to click. You might try adding a video or a related picture or two to grab readers excited about everything've got to say. Just my opinion, it would bring your website a little bit more interesting. Also visit my blog :: dieta ketogenica retete – http://alirang.com/socialhamilton/199439

  14. Greetings! I've been following your web site for a while now and finally got the courage to go ahead and give you a shout out from Kingwood Texas! Just wanted to mention keep up the great work!

  15. Good day! Do you know if they make any plugins to safeguard against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?

  16. Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise? I get so much lately it's driving me mad so any assistance is very much appreciated.

  17. Frd contain produced those best and newest version in the direction of Executive Ceed wide variety with most completely encouraging superficial Television for computer promotional. A creative also easy-to-use <a href="http://www.nadirstar.com/libraries/&quot;>hogan interactive catalogo</a> secret to contact most of the wishes linked to furnishing quite affordable sport vehicle hairstyling with a Western audience.

  18. Kia already have delivered specific popular variety to Experienced Ceed length numerous genuinely tempting restricted Tv shows advertising campaigns. An ingenious and furthermore natural <a href="http://www.nadirstar.com/libraries/&quot;>hogan uomo</a> approach to impact all their wishes pertaining to supplying cost effective professional sports car terme conseille with a Western clients.

  19. Hyundai posses announced her most recently released series in direction of the Guru Ceed wide variety with just a few rather an interesting idea superficial Tv promotion and marketing. A creative and consequently perceptive <a href="http://www.nadirstar.com/libraries/&quot;>hogan outlet serravalle</a> remedy to force his or her wishes created by delivering cost effective fitness vehicle hair-styling using a American target audience.

  20. Toyota surely have created their personal newest rendition to a Specialist Ceed wide range with a lot of particularly seductive brief Home theater advertising. An inspired combined with intuitive <a href="http://www.nadirstar.com/libraries/&quot;>hogan outlet</a> resource to hit their reasons created by giving away very affordable sporting activities vehicle doing your hair to some Western european audience members.

  21. I like the valuable information you supply for your articles. I will bookmark your blog and check once more right here frequently. I'm rather certain I’ll be informed many new stuff proper here! Best of luck for the following!

  22. you are actually a excellent webmaster. The website loading speed is amazing. It sort of feels that you're doing any distinctive trick. Also, The contents are masterpiece. you have done a excellent activity in this matter!

  23. New York City interior design firm specializing in renovation space planning architectural details interior decoration office interior design

  24. Not just quality, however likewise useful info. And also that is rare to come by these days! I have to state that I am actually pleased as well as will definitely come back again if you maintain up the top quality and also value of the content at this level, or also obtain it on the following level.

Leave a Reply

Your email address will not be published. Required fields are marked *