Вопрос

I have written a windows service code in C#.NET containing 2 threads running simultaneously which is working as per expected.

Now, I copied the same project to different location, built the solution and copied the service to the destination VM machine (Windows 7). But one of the threads stuck up at a function call i.e. once the execution reaches the function call, it gets stuck up and this thread just wont respond.. no exception nothing. Now, try to stop this service, it will take huge time, wont stop sometimes and will leave a stray process in the task manager which will be vanished after few minutes.

Same thing happened when I copied the solution to some another location.

Now, again, I use my original location, copy this service to destination VM machine and voila.. everything is working perfectly.

We tried calling some other function from the same class, it is getting called. But not the one which we want to.

And this happens only on my laptop. On my colleagues laptop, it works fine.

Anybody came across this issue?? Please help.

The code is as below - The calling function is a normal function from a class. The function which is getting called is inside a class which is as follows -

class A {

// Some variables 

public A(parameter a) // constructor
{ } 

void function1(object A) 
{ } 

bool function2(B b) // this is the calling class 
{ 
    Log("some message"); // this is 1st line of the function.
    ... ... 
}

} 

calling code is -

A a = new A(param);

a.function1(obj); // Works 

a.function2(this); // stuck up at this call.. do not even print log message which is at the entry point. even if we change or remove parameter altogether.. just have some issue with function
Это было полезно?

Решение

Just reinstalling Visual Studio worked for me. Thanks!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top