简体   繁体   中英

MessageBox not appearing when process starts when a WCF service calls Process.Start in C#

I want to debug a Windows managed (C++/CLI) process, which's being invoked by a WCF consumed service. It calls process.start on that process, but I am unable to pause that process becuase when its main method gets executed, MessageBox which's placed inside is not executed and prompted, so that after I can attach that process to VS Debugger. If I launch the process manually which's placed on the disk, it gives the message box, or if somehow I start the process with a test stub application which uses Process.Start, message Box appears.

I need to debug the C++/CLI managed process in the context of WCF consumer service written in C#, which actually dispatches the data as remoting objects after starting that process. Is there any way around this?

Regards,

Usman

Maybe messagebox doesn't appear because of WCF service launch it with a different user.

But if you can test your component, why "re-test" it under WCF?

Once you are sure there are not logical errors, all remaining bugs can be solved by properly trace execution ad data in your component and, if necessary, reproduce these errors in your test application.

I was also facing the same issue. It got resolved after checking "Allow Service to interact with desktop" on LogOn property page of the Windows Service

我不知道c ++,但是如果您可以访问.Net Framework,则可以致电Debugger.Launch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM