How to determine if a Full.NET 4 DLL is required or just a client profile

When using third-party assemblies, I need a way to determine if they need full .NET 4 or just the .NET 4 client profile.

I saw other ways to determine the .NET version on the Determine the .NET Framework version for dll , but the methods outlined in this question do not show how to detect the Profile vs Full client. Is it possible?

I am looking for any solution, this should not be a solution for code / runtime.

+5
source share
1 answer

Please note that the solution below applies to the .NET 4.0 platform and TargetFrameworkAttribueis new to 4.0.

: Client Framework, - . ildasm.exe, , TargetFrameworkAttribute. , :

using System;
using System.Linq;
using System.Runtime.Versioning;

class Program
{
    static void Main(string[] args)
    {
        var a = System.Reflection.Assembly.GetExecutingAssembly();
        var att = a.GetCustomAttributes(false).OfType<TargetFrameworkAttribute>().Single();

        Console.WriteLine(att.FrameworkDisplayName);
        Console.Read();
    }
}

: , , " .NET Framework 3.5" ( ildasm ). , , , , .

I , . , - ( , , 15% , " ", 41 , 48 ). .

+2

All Articles