Debugging Sandboxed Code in InfoPath 2010 Forms

In this video demo, Phil Newman from the InfoPath program management team shares some tips and tricks for debugging InfoPath forms with sandboxed code on SharePoint server 2010. Get Microsoft Silverlight

Here is this link to the ULS viewer tool that is used in the demo:


  • Process=SPUCWorkerProcess (for administrator-approved forms, filter on the W3WP process)
  • Message=Exception thrown from business logic
Comments (13)
  1. Bob_Chauvin says:

    I’m trying to get a form to open to a specific tab based on url parameters, to no avail.  It seems you cannot chage a form in the formload event.  Is there a formloaded event?

  2. Bob_Chauvin says:

    Correction to the text from my comment should read "… It seems you cannot switch to a View in the formload event…"

  3. infopath says:

    Hi Bob_Chauvin,

    If you want to switch views in the form "Loading" event, you need to use the "LoadingEventArgs" like this:


    The "SwitchView" method is used, say, on the Click event of a button.


  4. infopath says:

    Hi Bob,

    We also have a new DefaultView query parameter in InfoPath 2010.





  5. Bob_Chauvin says:

    Scott and Laura, Thanks for your assist.  The e.SetDefaultView("YourViewName"); seems to work as expected in the full client.  Will these approaches work for browser forms as well?

  6. infopath says:

    Hi Bob,

    Yes – these will work in the browser.


  7. Hired says:

    Hi, i can't debug any C# code for InfoPath 2010. If i'll try to run "Start debugging" in VSTA this error show: "Microsoft InfoPath does not recognize some or all of the command line options. …". What i have to do? Sorry for my english:-).

  8. infopath says:

    This looks like a bug that was in the pre-release 64 bit builds of InfoPath 2010, and which was fixed in the final released product.

  9. Lars Egelund says:

    I get the error "Microsoft InfoPath does not recognize some or all of the command line options. …" in the final release of InfoPath 2010 as well. I can see that Visual Studio for Applications is version 2005 – can this be correct?

  10. infopath says:

    The version of VSTA is correct. The known bug is fixed in the final build of Office 2010. Do you experience this issue on other machines? What about if you create a new InfoPath form and VSTA project?

  11. BobC says:

    Any word on creating an Infopath 2010 forum on MSDN?

  12. infopath says:

    InfoPath 2010 questions should be directed to the "SharePoint 2010 – Using SharePoint Designer, Infopath, and other customization" forum:…/threads

  13. Alex says:

    Hi, I'm trying to debug my code in InfoPath Desiger but it prompts "Microsoft InfoPath does not recognize some or all of the command line options. …", my version is 14.0.4763.1000, is this the final release you mentioned??

    Thanks for helping.

Comments are closed.

Skip to main content