Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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).

↑ Back to the top


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.

↑ Back to the top


Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

↑ Back to the top


Keywords: KB923527, kbprb, kbtshoot, kbexpertiseinter, kbarchive, kbnosurvey

↑ Back to the top

Article Info
Article ID : 923527
Revision : 1
Created on : 1/16/2015
Published on : 1/16/2015
Exists online : False
Views : 345