WCF Data Service Client library bug for Windows Phone 7

No.of Views838
Bookmarked0 times
Downloads 
Votes0
By  Dhananjay Kumar   On  07 Jul 2010 09:07:18
Tag : Windows Phone , Miscellaneous
In this article , i will show to how solve WCF Data Service Client library bug for Windows Phone 7.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Note: I would like to thank Tim for his solution and this article has been referred to his this http://timh.me/bAfFvh 


You can see video on this article

http://dhananjaykumar.net/2010/07/01/videofixingodataclientlibraryissue/

Background

When you download ODATA or WCF Data Service client library for Windows 7 phone and extract the System.Data.Service.Client.dll to some location and add this reference to your project. After adding this reference, when you run your application in emulator, you get DEPLOYEMNT FAILED error.  This article, will explain how to fix this bug and continue using WCF Data Service client library for Windows 7 phone application.

Assumption

I have assumed here that you have downloaded, ODATA or WCF Data Service client library for Windows 7 phone from below line
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b251b247-70ca-4887-bab6-dccdec192f8d

After download from here, run this, you will get the below screens 

Image Loading
Image Loading

Extract the dll in a particular directory.  Let us say you are extracting that in D:\DemoFolder.  So, in this folder, you will have below three files. 

Image Loading

So, here you are having System.Data.Service.Client.dll library. You need to add this as reference in your Windows7 Phone application to Consume WCF Data Service.

Working

Now when you add this reference in your windows7 phone application and try to run the application, you will find you are not getting any compile time error but your application is not loading. You may get below error message. You will get deployment error message. 

Image Loading

 

Image Loading

Solution

To solve this deployment error, you need to follow below steps

1.    Download  power shell script from  http://storage.timheuer.com/wp7ctpfix.ps1
2.    Save the power script in the same folder where you have put your DLL.
3.    Open the power script window, and run the script.  see  the video  here
 

Command to be run

1.    Navigate to folder, where you copied and pasted ODATA client library DLL and Power shell script, you downloaded in previous step.
2.    Once you navigate to folder, you will able to see power scrip file you downloaded in previous steps.

Now just run the below command

.\wp7ctpfix.ps1 .\System.Data.Services.Client.dll 

Image Loading

Now a new dll will get created in the same folder. Add this dll in your Windows7 phone application and you would be able to use the client library. Thanks for reading. I hope, this post was useful. Happy Coding.

 
Sign Up to vote for this article
 
About Author
 
Dhananjay Kumar
Occupation-Software Engineer
Company-Infosys Technolgies,Pune
Member Type-Gold
Location-India
Joined date-20 Jul 2009
Home Page-http://dhananjaykumar.net/
Blog Page-http://dhananjaykumar.net/
Dhananjay Kumar is Microsoft MVP on connected system. He blogs at http://dhananjaykumar.net/ . You can follow him http://twitter.com/debugmode_/ and reach him at dhananjay.25july@gmail.com
 
 
Other popularSectionarticles
    In this article we will retrieve data from SharePoint list and display it Windows 7 phone application.
    Published Date : 03/Dec/2010
    Introducing Windows Phone 7 Series
    Published Date : 11/Apr/2010
    In this article I will explain, how to handle buffer the entire recording in memory before writing it to a file. A rather astute reader asked me what would happen if the user let the recording go long enough to fill up memory. The answer to that question is the application would crash due to an exception being thrown when it fails to allocate more memory and all of the recording would be lost.
    Published Date : 21/May/2011
    You've got a class that contains data that you want to be able to save and load in IsolatedStorage on Windows Phone 7. How would you go about doing that? There is more than one way, but I wanted to share a generic solution for didactic purposes; I'm finding that many beginners like to start off with a single satisfying solution and brance off into specialized solutions later. Let's say that you are starting off with a stereotypical Employee class.
    Published Date : 05/Mar/2011
    In this article, i'm going to show to you,How to get System Information on Windows Phone 7
    Published Date : 06/Nov/2010
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top