> We could somehow also support having references using (fully qualified)
> assembly names (NAnt.Core, Version=..., Culture= ...,
PublicKeyToken=....),
> but I have no idea how to resolve a fully qualified assembly name to it's
> file path (anyone ?)

Slow, but: load the assembly using Assembly.Load into a new appdomain then
read its CodeBase or Location:

using System;
using System.Reflection;

class Class1
{
 public static void Main()
 {
  Assembly a = Assembly.Load("System.Data, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089");
  Console.WriteLine("a.CodeBase = {0}", a.CodeBase);
  Console.WriteLine("a.Location = {0}", a.Location);
  Console.WriteLine("a.GlobalAssemblyCache = {0}", a.GlobalAssemblyCache);
 }
}

Outputs:

a.CodeBase =
file:///f:/windows/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
a.Location =
f:\windows\assembly\gac\system.data\1.0.3300.0__b77a5c561934e089\system.data
.dll
a.GlobalAssemblyCache = True

Maybe results like this can be cached?

Jarek



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to