Since you are using .Net framework 1.1, the following should work for you:
1. mscoree!GetFileVersion will tell you which runtime the assembly is
compiled against. I briefly talked about this API here
http://blogs.msdn.com/junfeng/archive/2004/02/06/68334.aspx. 2. Assume you know how to use 1). And you can identity Microsoft Assemblies
by validating publicKeyToken. What you can do is enumerate GAC, find the
path of every assembly, call mscoree!GetFileVersion on the file. If
mscoree!GetFileVersion reports v1.1.4322, then it belongs to 1.1. If it
returns v1.0.3705, then it belongs to 1.0.
Of course, in 2) you will have to use Fusion APIs.
Anything starts with a version number 7.x belongs to Visual Studio. For 1.0
and 1.1 framework assemblies, their version numbers always start with 1.0.
Some of VS assemblies are shared between VS 2002 and VS 2003.
--
Junfeng Zhang
http://blogs.msdn.com/junfeng This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] "Sergey M" <no_spam_for_you> wrote in message
news:%23t2CUQSiEHA.1764@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I have an application that collects GACed assemblies published by
> Microsoft only and their types using Fusion APIs. The application's
> written using VS.NET 2003. I'd like for the application to only target
> run-time v1.1 GACed assemblies.
>
> I've managed to isolate Microsoft's assemblies by validating
> PublicKeyToken. The problem I'm having is trying to figure out how to
> associate an assembly in GAC with run-time v1.1. I'd like to avoid
> dynamically loading run-time v1.0 assemblies.
>
> Trying to match application run-time version (Environment.Version) to
> assembly version works most of the times but there are some exceptions.
> Some of the VS.NET 2003 assemblies have a different version scheme that
> starts with major version 7.0. Some have different builder numbers for
> VS.NET 2002 and 2003. There are also few of them that only have one
> version in GAC and it matches VS.NET 2002 version number, yet is
> installed into v1.1 folder, EnvDTE v7.0.3300.0 for example.
>
> Could anyone shed some light onto this or give me a push into a right
> direction please? Thanks in advance.
> --
> Sergey M
>
http://www.usysware.com/dpack/ >
>
>