0

I use CameraCaptureTask to invoke camera in my app. It works well for me most of times but ocassionally it hangs and CameraCaptureTask's show method does not invoke camera. When I checked the log it throws System.InvalidOperationException. Here is the stack trace:-

System.InvalidOperationException at Microsoft.Phone.Tasks.ChooserListener.RegisterChooser(IChooser chooser) at Microsoft.Phone.Tasks.ChooserBase`1.Show(Uri appUri, ParameterPropertyBag ppb) at Microsoft.Phone.Tasks.CameraCaptureTask.Show() at name.LatestBrowseMedia.AddMediaClick(Object sender, EventArgs e) at Microsoft.Phone.Shell.ApplicationBarItemContainer.FireEventHandler(EventHandler handler, Object sender, EventArgs args) at Microsoft.Phone.Shell.ApplicationBarIconButtonContainer.ClickEvent() at Microsoft.Phone.Shell.ApplicationBar.OnCommand(UInt32 idCommand, Boolean isButton) at Microsoft.Phone.Shell.Interop.NativeCallbackInteropWrapper.OnCommand(UInt32 idCommand, Boolean isButton)

My code simply makes show method call. Please help me out. Thanx in advance.....

red devil
  • 113
  • 8
  • Please show your code, don't just describe it. – Matt Lacey Jul 17 '13 at 13:50
  • Have you set the capabilities in the project properties as to requiring camera access? – Blounty Jul 19 '13 at 05:23
  • @Blounty Ofcourse I do have camera access capabilities set otherwise camera would not have worked in first place. This issue happens occasionally and there is no fix pattern to it. – red devil Jul 19 '13 at 05:34
  • @MattLacey There is not much in the code. I have an object of CameraCaptureTask say: CameraCaptureTask ctask=new CameraCaptureTask(); ctask.show(); That is the only thing I am doing.... – red devil Jul 19 '13 at 05:37
  • @reddevil apologies, i misread the question, What device are you testing on, have you tested on multiple devices, are any other camera apps running? – Blounty Jul 19 '13 at 07:29

0 Answers0