Here is the situation:
I am trying to code a form to access data from our AD. I enabled the form for Full Trust, placed the form code in place and it will build without errors. When the form trys to open (preview) I get the error. Whe I try to open the form from the template I get this error:
Form template: file:///REMOVEDFILEPATHFORTHISTHREAD.xsn
InfoPath cannot open the selected form because of an error in the form's code.
System.Security.SecurityException, mscorlib
System.Security.SecurityException: Request for the permission of type 'Microsoft.Office.InfoPath.InfoPathPermission, Microsoft.Office.InfoPath.Client.Internal.Host, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.
at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Microsoft.Office.InfoPath.XmlFormHostItem.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.Initialize()
at Microsoft.VisualStudio.Tools.Applications.EntryPointAdapter.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.Initialize()
The action that failed was:
Demand
The type of the first permission that failed was:
Microsoft.Office.InfoPath.InfoPathPermission
The Zone of the assembly that failed was:
MyComputer
My question: Is this a trust issue with the form? I can't even preview it so it's got me confused