I have a form template created in InfoPath 2007 with some custom code behind that I want to upgrade to 2010. I opened the .xsn in design mode in 2010, went to code editor, told it where to find my .proj for the custom code, went to the Programming tab in Advanced Form Options and clicked "Upgrade OM" (it now reads C#), saved the form template as "InfoPath Web Browser Form Template" (2010), and then published as a Administrator-approved form template.
When I try to upload the form template to my SharePoint 2010 farm through Central Admin, it tells "The form template has been successfully uploaded to the farm." I hit ok, I'm redirected to Manage Form Templates, the status is "Installing" momentarily, then it becomes "Failed to Upload." I view the properties of this form template, and click the "Failed to Upload" status link and get this error first:
Failed to load receiver assembly "Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" for feature "FT-01-9f26398f-468a-5114-c40a-d656226b4d28" (ID: 9f26398f-468a-5114-c40a-d656226b4d28).: System.IO.FileNotFoundException: Could not load file or assembly
I grabbed this version 12 dll from my 2007 SP farm, and install it in the GAC. I did an IISReset, recompiled my form template, republished and got the same results. Finally I restarted my server, reuploaded and then I got this error:
Could not load file or assembly 'Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I installed that dll to my GAC, repeated all of the steps (even restarting), and then got this error:
Could not load file or assembly 'Microsoft.Office.Server.Diagnostics, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I GAC'd that dll, repeated again and now I'm getting:
Unable to cast object of type 'Microsoft.Office.InfoPath.Server.Administration.FormsService' to type 'Microsoft.Office.InfoPath.Server.Administration.FormsService'.
I'm certain it is not my custom code referencing these 2007 assemblies. I used .Net Reflector to verify.
This leads me to believe that something went wrong with my upgrade of the form template from InfoPath 2007 to 2010. Somehow it is holding on to the older versions of InfoPath’s core assemblies. Has anyone experienced this or know how to fix it? I'm trying to avoid recreating this complex form template from scratch in 2010.
Thanks!