Click here to Skip to main content
15,886,065 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
1. Hi All,
while I change or modify something in data access layer, I am getting below mentioned error.

1. Unable to copy file "C:\bin\Debug\ajaxservice.Data.dll" to "bin\Debug\ajaxservice.Data.dll". The process cannot access the file 'bin\Debug\ajaxservice.Data.dll' because it is being used by another process. ajaxservice.Services

2. Unable to copy file "C:\bin\Debug\ajaxservice.Business.dll" to "bin\Debug\ajaxservice.Business.dll". The process cannot access the file 'bin\Debug\ajaxservice.Business.dll' because it is being used by another process. ajaxservice.Services
After I restarting the system the error will not be again but I am getting method calling twice problem.
(Actually I am calling some WCF method from java script and some directly from C#. The menthod is calling multiple times whenever calling from java script. If I call from C#, the same methods working fine. Please help me how to fix this.)
var service = new Hotal.Services.IMenuSearchService();
service.FindRestaurant(City, Area, onRestaurantSeachSuccess, onRestaurantSeachFailed, null);

the below method only calling twice:


public IEnumerable<Data.NewRestaurantHeader> FindRestaurant(string City, string Area)
        {
            Business.Menu menu = new Business.Menu();
            return menu.FindRestaurant(City, Area);
        }


public IEnumerable<Data.NewRestaurantHeader> FindRestaurant(string City, string Area)
        {
            // LinQ query here
        }




2. I am calling some WCF method from java script and some directly from C#. The menthod is calling multiple times whenever calling from java script. If I call from C#, the same methods working fine. Please help me how to fix this.)

var service = new ajax.Services.IMenuSearchService();<br />
service.FindRestaurant(City, Area, onRestaurantSeachSuccess, onRestaurantSeachFailed, null);


the below method only calling twice:

public IEnumerable<Data.NewRestaurantHeader> FindRestaurant(string City, string Area)
        {
            Businesslayer menu = new Businesslayer ();
            return menu.FindRestaurant(City, Area);
        }



public IEnumerable<Data.NewRestaurantHeader> FindRestaurant(string City, string Area)
       {
           // LinQ query here
       }


3. The wcf method calling twice while running from windows server 2008 + IIS 7 but if I run from local are all working fine.
Posted
Updated 8-Feb-21 6:47am
v2
Comments
#realJSOP 28-Dec-11 9:58am    
This is a duplicate of a question asked earlier today by someone else (or by you with a different user ID). Why don't you monitor that question instead?

The solution to your problem "Unable to copy file ...." is that you need to close your visual studio solution and delete all the dlls generated in bin/debug or bin/release from the project. Then open the visual studio, open the solution and build it again. It will work fine.

The permanent solution for this will be to remove the read-only attributes on the bin folders for all projects in the solution.


The WCF service is called twice be because the size of the message is greater than the default message size. You might try increasing the this value in the configuration of the endpoint
 
Share this answer
 
v4
I know this is an old post, but I keep getting a similar problem, google it, and then remember what I keep doing.

For the multiple posts by javascript, here is what I sometimes accidently do and get the same behavior.

My WCF Method is defined as returning SomeBaseClass.
I extend this class for specific calls, ie SomeBaseClassExtended.

In my method, I may be trying to return SomeBaseClassExtended instead of the how the method's signature is defined as SomeBaseClass.

This is not a compile error, so it's easy to miss.

When this happens, I find that a breakpoint in the wcf method will get hit multiple times and I finally receive an http 504 error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900