This exception is often seen when attempting to call from partially trusted
code into a strongly named assembly that is not marked with
AllowPartiallyTrustedCallersAttribute. Might this explain your current
problem? If you're not sure, could you please provide more details about
what MyMethod does?
[quoted text, click to view] <rajesh.k.ppati@gmail.com> wrote in message
news:1148987381.521948.245330@j73g2000cwa.googlegroups.com...
> Hi,
> I get a Security Error when my WebService makes a call a method in
> another assembly.
> The details of the exception as viewed in immediate window of Visual
> Studio are pasted below.
> I am able to debug my WebService method.
> However, when it tries to call a method in another assembly, it fails.
> What is the most likely reason of the error ?
> Rajesh
>
> ?ex
> {"Security error." }
> [System.Security.SecurityException]: {"Security error."}
> System.Object: {System.Security.SecurityException}
> _className: null
> _COMPlusExceptionCode: -532459699
> _exceptionMethod: <undefined value>
> _exceptionMethodString: null
> _helpURL: null
> _HResult: -2146233078
> _innerException: { }
> _message: "Security error."
> _remoteStackIndex: 0
> _remoteStackTraceString: null
> _source: null
> _stackTrace: {System.Array}
> _stackTraceString: null
> _xcode: -532459699
> _xptrs: 0
> HelpLink: null
> HResult: -2146233078
> InnerException: { }
> Message: "Security error."
> Source: "MyDLL"
> StackTrace: " at MyDLL.MyClass.MyMethod()\r\n at
> MyDll.MyClass.MyMethod2() in
> D:\\Development\\WebServices\\MyDll\\MyClass.asmx.cs:line 89"
> TargetSite: <error: an exception of type:
> {System.Security.SecurityException} occurred>
>