Mittwoch, 7. November 2012

Unsupported namespace in InfoPath code

System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Office.InfoPath.Server.Converter.DetectUnsupportedNamespaces.VerifyNamespace(String ns, String nodeName, ICollection`1 problems)

at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.<>c__DisplayClass2.b__1(MethodBase method)
at Microsoft.Office.InfoPath.Server.Converter.BusinessLogicScanner.VisitMethod(MethodBase method, MethodInfoVisitor methodVisitor)

....

You are using custom code in InfoPath, and you are using code in your project that doesn't have the same namespace as the form.  For example a helper function that you've included in your code.
When InfoPath Forms Services attempt to validate your form, it finds that your form template contains reference to code that doesn't have a namespace!
Solution:
Just create a namespace for the helper class, or move the helper class under the namespace of the form's namespace.