Background:
I am hosting InfoPath documents within a VS 2008 WinForm application using the FormControl control. The application launches a WinForm with FormControl to host varying InfoPath documents. When the WinForm is closed, the FormClosing event close the active InfoPath document using the FormControl.Close() method followed by FormControl.Dispose() method.
InfoPath 2007
VS .Net Framework 3.5 sp1
Microsoft.Office.InfoPath Run Time Version: v2.0.50727 Version 12.0.0.0
Microsoft.Office.InfoPath.Client.Internal.Host Run Time Version: v2.0.50727 Version 12.0.0.0
Microsoft.Office.InfoPath.FormControl Run Time Version: v2.0.50727 Version 12.0.0.0
Microsoft.Office.Interop.InfoPath Run Time Version: v1.1.4322 Version 12.0.0.0
Microsoft.Office.Interop.InfoPath.XML Run Time Version: v1.1.4322 Version 12.0.0.0
Problem:
When the application is installed on a Win XP machine the forms open and close in a timely manner.
When the application is installed on a Win 7 machine the forms open in approximately the same time as on XP. The FormControl.Close() takes 1-2 seconds on XP, but on Win 7 it may take up to 30 seconds. If the same InfoPath document is opened and closed a second time the FormControl.Close() doubles to 60 seconds.
If I comment out the FormControl.Close() the form closes in 1-2 seconds on Win 7.
Has anyone run into this problem or have a solution? Can the FormControl.Close() be removed without causing other issues?
Regards,
Jeff