Hello

I need to run method in context of different process.

I have w3wp.exe process and I want to start kind of debugger that is included with . In order to do this there I have to run static method (public static StartDebug(string filePath,uint debugParam) of class (DebugServer). Unfortunatelly before app deploying I didn't prepare correct webmethods, and now I need to run a static method of one class that belongs to the project.

I want to create winforms application and run it somehow.

Any ideas how can I make it ?

Can't you just attach the debugger to the process? It sounds like you need to redeploy but maybe someone else has another idea

The stuff about the debugger, I don't understand.
If you want to make a winforms application download Visual Studio C# Express. It is free.

Ok I mixed a little.

I created a WebService and deployed it on Client’s machine.

WebService uses external component (DLL). But this component doesn’t work the way I want to. There is a possibility to run “debug mode” of this component, then it will dump some data into the text file on HDD. In order to run this mode I have to run static method of one class that is provided with the component’s dll.

I can’t redeploy it on client’s machine because it is working so I came up with an idea of running small winforms application that will run this static method in context of this WebService.

Static methods are limited to the application domain's scope so if you created a windows form application to call the debug method then it would start the assembly's debug routines in the scope of the winform application -- leaving your web service untouched.

You would effectively be running two versions of the same thing which may cause other problems depending on what the service is doing.

I know that is why I wanto to run this method in the context of this WebService.

I think that CreateRemoteThread should do the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.