Is Framework Assembly - CSharp System.Reflection

CSharp examples for System.Reflection:Assembly

Description

Is Framework Assembly

Demo Code

// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Text;
using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System;//from   w ww.j a  va2 s.c o m

public class Main{
        public static bool IsFrameworkAssembly(this Assembly assembly)
        {
            byte[] publicKeyToken = assembly.GetName().GetPublicKeyToken();

            return publicKeyToken.Length > 0 && frameworkTokens.Any(t => t.SequenceEqual(publicKeyToken));
        }
}

Related Tutorials