Domanda

I have a client/server multithreaded application and one thread is used to send a regular ping to the server. The problem appears when i want to debug other threads it also blocks my ping thread. I already tryed options in Visual Studio Debug->Windows->Thread but don't want to use it each time i need to debug a part of my application.

Moreover as I work in a team I can't force my teammates to use this technique. How can I do this without much effort for them (macro, ...)?

Thanks

edit: It's not a duplicate thread! I don't want to use conditional break point every time i need to debug my application! And don't want to complexity the debug procedure for the rest of my team. I searched everywhere and nobody spoke about executing the thread in another Process

È stato utile?

Soluzione

Thanks everyone i finally found an answer to my question!

As @hyde suggested i run my Ping loop in another process, but rather than create another program i dynamically create and execute it from my code

as seen in this topic: Is it possible to dynamically compile and execute C# code fragments?

And this more advanced topic: http://simeonpilgrim.com/blog/2007/12/04/compiling-and-running-code-at-runtime/

But after all i still had a problem... I needed to share my NetworkStream between my Main Application and his Child (needed to send to the same server Thread), so i gave to the child the NetworkStream by reflection.

Now work correctly, thanks!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top