0

I have a component, which silently retrieves some data from web using .NET WebBrowser component. It is written so that it will not show any dialog boxes, or any other interactive UI components, but since it is a form component, I need to create a form and STA thread to host it. I'm then starting it using Form.ShowDialog()

This works perfectly, except I cannot run this setup in non-interactive service. When I'm trying to do this, I'm receiving an exception "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

Is there any way to configure a service so that it runs WebBroswer anyway, without displaying any UI or anything?

galets
  • 17,802
  • 19
  • 72
  • 101
  • what is it about the content that requires a browser environment? why can you not simply interact with the server directly? – Sky Sanders Feb 23 '10 at 04:41
  • My app logs on to my.t-mobile.com to obtain balance, they have javascript peppered all over their website, need to have something that emulates actual browser. If you know of better way to do this I would be super glad to hear it, I'm not happy with the way I implemented it either, but I know not about another way – galets Feb 23 '10 at 16:39

1 Answers1

1

No, there isn't, this change was made from Windows Vista on as a security measure that you have to opt-in to in order to use.

Generally speaking, what you are doing isn't the best way to get scrape content, but if you must do it this way, then you will need to enable the service to interact with the desktop.

casperOne
  • 73,706
  • 19
  • 184
  • 253