安全透明方法 'PayPal.UserAgentHeader.get_OperatingSystemFriendlyName()' 尝试访问安全关键方法 'System.Management.ManagementObjectSearcher..ctor(System.String)' 失败。
Assembly 'PayPalCoreSDK, Version=1.4.1.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MethodAccessException: Attempt by security transparent method 'PayPal.UserAgentHeader.get_OperatingSystemFriendlyName()' to access security critical method 'System.Management.ManagementObjectSearcher..ctor(System.String)' failed.
Assembly 'PayPalCoreSDK, Version=1.4.1.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.
这个stackoverflow答案提到需要在类中添加[SecuritySafeCritical]
属性,但在这种情况下,所涉及的类是通过NuGet加载的DLL。
是否有任何全局设置可以用来绕过此异常?