Wednesday, May 2, 2012

Infopath: An unexpected error has occurred while verifying the form template

Recently when trying to deploy an InfoPath form to the Production server, I got this error: "An unexpected error has occurred while verifying the form template".

At first, I thought there was something wrong with this form. Google brought me here: http://social.msdn.microsoft.com/Forums/en/sharepointinfopath/thread/8219b3f6-e18c-42ee-b572-0459b912898c, which suggests that the form server may stopped working.   I started up "SharePoint Manager 2010", and compared the forms service settings between the development server and the production server, and could not find any difference.

No error message in windows events log.

Then, as usual, I start to monitor SharePoint system log, and noticed the error message below:


ConstructFromXsnFile failed with unhandled exception System.MissingMethodException: Method not found: '?????????'.    
 at System.ModuleHandle.ResolveMethod(Int32 methodToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)    
 at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)    
 at System.Reflection.Module.ResolveMethod(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)    
 at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.VisitBody(MethodBase method, MethodInfoVisitor methodVisitor)    
 at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.VisitBody(MethodBase method, MethodInfoVisitor methodVisitor)    
 at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.VisitMethods(Type mainType, MethodInfoVisitor methodVisitor)    
 at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.Analyze(Type mainType, List`1 rules)    
 at Microsoft.Office.InfoPath.Server.SolutionLifetime.BusinessLogicLoader.VerifyUsingFxCop(Assembly rootAssembly)    
 at Microsoft.Office.InfoPath.Server.SolutionLifetime.BusinessLogicLoader.Microsoft.Office.InfoPath.Server.SolutionLifetime.ISolutionComponent.Parse(XPathNavigator documentClassNode, XmlNamespaceManager solutionNamespaceManager, ConversionContext context)    
 at Microsoft.Office.InfoPath.Server.SolutionLifetime.Solution.ParseManifest(ConversionContext context, XPathNavigator node)    
 at Microsoft.Office.InfoPath.Server.SolutionLifetime.Solution.LoadFromXsn(ConversionContext context, SolutionCabinet solutionCabinet, SolutionIdentity solutionId)    
 at Microsoft.Office.InfoPath.Server.SolutionLifetime.Solution.<>c__DisplayClass2.b__0()    
 at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

Obviously, the code of the InfoPath form has some assembly reference which linked to a non-exist method on the production server, and that's the problem.  I forgot to upgrade that assembly on the production server!

No comments:

Post a Comment