/// <summary>
/// Returns the file name to an assembly, regardless of what
/// type the assembly is.
/// </summary>
string GetReferencedFileName(ConfigurationSelector configuration)
{
switch (ReferenceType)
{
case ReferenceType.Assembly:
return(reference);
case ReferenceType.Gac:
string file = AssemblyContext.GetAssemblyLocation(Reference, package, ownerProject != null? ownerProject.TargetFramework : null);
return(file == null ? reference : file);
case ReferenceType.Project:
if (ownerProject != null)
{
if (ownerProject.ParentSolution != null)
{
Project p = ownerProject.ParentSolution.FindProjectByName(reference);
if (p != null)
{
return(p.GetOutputFileName(configuration));
}
}
}
return(null);
default:
Console.WriteLine("pp: " + Reference + " " + OwnerProject.FileName);
throw new NotImplementedException("unknown reference type : " + ReferenceType);
}
}