I’ve recently gone onto Windows 7, and, like every one else it seems, I’m pretty happy with it. Only thing I have found is that using Managed Code in InfoPath 2007 now requires the form to be fully trusted.
It used to be the case that on your own machine, you could allow the form manage it’s own trust level whilst developing with managed code. However, this has changed in Windows 7 – and you may get the error shown below:
System.Security.SecurityException
Request failed.
at Microsoft.Office.InfoPath.MsxmlNavigator.IsValidNode(MsxmlNode test)
at Microsoft.Office.InfoPath.MsxmlNavigator.MoveToFirstChild()
at MS.Internal.Xml.XPath.XPathChildIterator.MoveNext()
at MS.Internal.Xml.XPath.ChildrenQuery.Advance()
at MS.Internal.Xml.XPath.ChildrenQuery.Advance()
at MS.Internal.Xml.XPath.ChildrenQuery.Advance()
at MS.Internal.Xml.XPath.XPathSelectionIterator.MoveNext()
at System.Xml.XPath.XPathNavigator.SelectSingleNode(XPathExpression expression)
at System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath, IXmlNamespaceResolver resolver)
at ContactForm.FormCode.SubmitToList()
at ContactForm.FormCode.cmdSubmit_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
To fix this, the form needs to fully trusted:
A minor annoyance, but hopefully it might save you guys some time…
davros.
Making a form full trust should be a last resort when you absolutely need it, e.g. to access files on the client filesystem or perform other “full trust” activities.
Using the XPathNavigator (which is causing the error here) is not a full trust situation, but this is an issue in .NET 3.5.
Apparently the fix for this is to install Office 2007 SP2, and I think that would be preferable to making all of your managed code forms full trust.
I agree, it’s never ideal to have to assign full trust. But Office SP2 – ok, cheers for the heads up.
Just loved the blog name! And thanks for the usefull tip on Office SP2 🙂