couldn't copy pdb file to another directory while consuming wcf web service

141 views Asked by At

I have a WCF Web Service and there is one method which returns sensor lists. When I want to consume this web service in a Console Application in Debug Mode, I got these 2 errors as;

Could not copy "obj\Debug\ConsumeHelper.pdb" to "bin\Debug\ConsumeHelper.pdb". Exceeded retry count of 10. Failed.  ConsumeHelper

and

Unable to copy file "obj\Debug\ConsumeHelper.pdb" to "bin\Debug\ConsumeHelper.pdb". The process cannot access the file 'bin\Debug\ConsumeHelper.pdb' because it is being used by another process. ConsumeHelper

Also I'm adding consumer method as given below.

        SensorServiceClient client = 
                    new SensorServiceClient("WebHttpBinding_ISensorService");
        Sensor[] sensor = client.getAllSensors("true");  
        Console.WriteLine("Sensor name is "  + sensor[0].Name);
        Console.ReadLine();

So, can anyone lead to me solution? Thanks for everyone.

1

There are 1 answers

0
Rahul On BEST ANSWER

Per your latest comment where you say

ConsumeHelper is client project and it consumes WCF service

Make sure you are not already running that project. I doubt it's already running and so the pdb file is not able to copy. Else, try running in Release mode instead of Debug mode.