思维呼唤多次 [英] menthod is calling multiple times

查看:89
本文介绍了思维呼唤多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在更改或修改数据访问层中的某些内容时,出现以下提到的错误.
1.无法将文件"C:\ bin \ Debug \ ajaxservice.Data.dll"复制到"bin \ Debug \ ajaxservice.Data.dll".该进程无法访问文件"bin \ Debug \ ajaxservice.Data.dll",因为它正在被另一个进程使用. ajaxservice.Services
2.无法将文件"C:\ bin \ Debug \ ajaxservice.Business.dll"复制到"bin \ Debug \ ajaxservice.Business.dll".该进程无法访问文件"bin \ Debug \ ajaxservice.Business.dll",因为该文件正在被另一个进程使用. ajaxservice.Services
重新启动系统后,错误不会再出现,但是我正在调用两次方法的问题.
(实际上,我是从Java脚本中调用某些WCF方法,而直接从C#中调用某些方法.方法是从Java脚本中调用时多次调用.如果我从C#中调用,则相同的方法也可以正常工作.请帮助我解决此问题.)
var service = new Hotal.Services.IMenuSearchService();
service.FindRestaurant(City,Area,onRestaurantSeachSuccess,onRestaurantSeachFailed,null);

以下方法仅调用两次:

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

        }

推荐答案

这告诉我,其他一些代码多次调用javascript方法.也许您正在调用一次运行代码的方法,然后调用方法再次运行代码本身.很难说是怎么回事,因为只有您才能在调试器下运行您的代码,以查看其发生原因.
That tells me that some other code is calling the javascript method multiple times. Perhaps you''re calling a method that runs the code once, and then the calling method runs the code itself a second time. It''s hard to tell what''s going on, because only YOU can run YOUR code under the debugger to see why it''s happening.


这篇关于思维呼唤多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆