Can anyone help with the following error?
System.InvalidOperationException
The _Startup or _Shutdown method in this
form's code contains one or more calls to members of the
Microsoft.Office.Interop.InfoPath.SemiTrust namespace. Calls to this namespace
from these methods are not permitted.
at
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments,
SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)
at
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments,
Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)
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.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder
binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name,
BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
CultureInfo culture)
at
Microsoft.Office.Interop.InfoPath.SemiTrust.InfoPathOMHelper.Run(String
assemblyFullPathName)
System.Security.SecurityException
Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at
System.Security.Principal.WindowsIdentity.GetCurrent()
at
Scorecard.FormCode.FormEvents_OnLoad(DocReturnEvent
e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent
pEvent)