diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs index 92f642c2a9..123f810aa2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs @@ -824,7 +824,13 @@ namespace ICSharpCode.NRefactory.TypeSystem void AddSecurityAttributes(SecurityDeclaration secDecl, IList targetCollection) { - var blobSecDecl = new UnresolvedSecurityDeclarationBlob((int)secDecl.Action, secDecl.GetBlob()); + byte[] blob; + try { + blob = secDecl.GetBlob(); + } catch (NotSupportedException) { + return; // https://github.com/icsharpcode/SharpDevelop/issues/284 + } + var blobSecDecl = new UnresolvedSecurityDeclarationBlob((int)secDecl.Action, blob); targetCollection.AddRange(blobSecDecl.UnresolvedAttributes); } #endregion