Help and Support
 

powered byLive Search

Error message when you try to debug an InfoPath form project that is built by using VSTO or VSTA: "System.Collections.Generic.KeyNotFoundException"

Article ID:923527
Last Review:November 3, 2006
Revision:1.1

SYMPTOMS

When you try to debug and test an InfoPath form project that contains command line arguments, you receive the following error message:
System.Collections.Generic.KeyNotFoundException
The given key was not present in the dictionary.
You receive the error message if the InfoPath form project is built by using Microsoft Visual Studio Tools for Office System (VSTO) or Microsoft Visual Studio Tools for Applications (VSTA).

WORKAROUND

VSTO

To work around this issue in a VSTO project, follow these steps:
1.In Visual Studio, click ProjectName Properties on the Project menu, and then click Debug.
2. In the Start Action section, select Start external program, and then locate the Infopath.exe file.
3. In the Start Options section, type the following in the Command line arguments box:
/preview "Path\manifest.xsf" /sampledata "Path\template.xml" /viewname "View 1" /inputparameters "Parameter"
Note The view name may not be "View 1." You must verify the view name in the project.

Parameter is the placeholder for the parameter that you want to pass.
4.Press F5 to debug the project.

VSTA

To work around this issue in a VSTA project, follow these steps:
1.Create a new XML file that is based on the InfoPath form template. The InfoPath form template is an .xsn file.
2.Save the XML file as Test.xml.
3. Click Start, click Run, type InfoPath "Path\Test.xml" /inputparameters "Parameter" in the Open box, and then click OK.

APPLIES TO
Microsoft Office InfoPath 2007
Microsoft Visual Studio 2005 Tools for the Microsoft Office System

Back to the top

Keywords: 
kbexpertiseinter kbtshoot kbprb KB923527

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.