セキュリティ上重要なメソッド 'System.Management.ManagementObjectSearcher..ctor(System.String)'にアクセスするための 'PayPal.UserAgentHeader.get_OperatingSystemFriendlyName()'が失敗しました。セキュリティ上重要なメソッドにアクセスするセキュリティトランスペアレントメソッドによる試みが失敗しました
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.
This stackoverflow answerクラスに[SecuritySafeCritical]
属性を追加言及が、この場合には遊んでいるクラスは、NuGetを使ってロードDLLです。
この例外を回避するために使用できるグローバル設定はありますか?
感謝を。信頼レベルは既にフルになっています。私はDLLに署名し、セキュリティに敏感なコードを調整し、再コンパイルすることでこの問題を解決しました。私はPayPal SDKがオープンソースであることを嬉しく思います。あるいは私はSOLでした! – Zerkey
「セキュリティに敏感なコードを微調整した方法」を説明してください。私は今、この問題を抱えています。私のDLLは署名されており、信頼=完全であり、これは動作しません。 – antman1p