La meilleure façon de vérifier si le fichier DLL est un assembly CLR en C#

Quelle est la meilleure façon de vérifier si le fichier DLL est une DLL Win32 ou si c'est un assembly CLR. En ce moment j'utilise ce code

    try
    {
        this.currentWorkingDirectory = Path.GetDirectoryName(assemblyPath);

        //Try to load the assembly.
        assembly = Assembly.LoadFile(assemblyPath);

        return assembly != null;
    }
    catch (FileLoadException ex)
    {
        exception = ex;
    }
    catch (BadImageFormatException ex)
    {
        exception = ex;
    }
    catch (ArgumentException ex)
    {
        exception = ex;
    }
    catch (Exception ex)
    {
        exception = ex;
    }

    if (exception is BadImageFormatException)
    {
        return false;
    }

Mais je tiens à vérifier avant de charger parce que je ne veux pas de ces exceptions (le temps).

Est-il un meilleur moyen?

InformationsquelleAutor schoetbi | 2009-09-02