Microsoft KB Archive/923527

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

Article ID: 923527

Article Last Modified on 11/3/2006

-

APPLIES TO


 * Microsoft Office InfoPath 2007
 * Microsoft Visual Studio 2005 Tools for the Microsoft Office System

-





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



VSTO
To work around this issue in a VSTO project, follow these steps:  In Visual Studio, click  Properties on the Project menu, and then click Debug. In the Start Action section, select Start external program, and then locate the Infopath.exe file. In the Start Options section, type the following in the Command line arguments box:

/preview &quot; \manifest.xsf&quot; /sampledata &quot; \template.xml&quot; /viewname &quot;View 1&quot; /inputparameters &quot; &quot;

Note The view name may not be &quot;View 1.&quot; You must verify the view name in the project.

is the placeholder for the parameter that you want to pass. 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 &quot; \Test.xml&quot; /inputparameters &quot; &quot; in the Open box, and then click OK.

Additional query words: IP2007 InfoPath2007 57630

Keywords: kbexpertiseinter kbtshoot kbprb KB923527

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.