I'm using this.GetProjectOptions("Release").ReferenceAssemblies to access the assemblies in my custom project type in my ProjectNode class. It seems that there might be a possible bug in the GetProjectOptions in ProjectNode.cs. The code below is the code at the end of the method. In my project file the System.dll assembly is defined as follows:
<Reference Include="System">
<Name>System</Name>
</Reference>
The code below calls GetMetadata(ProjectFileConstants.AssemblyName) and appends ".dll". There is no assemblyname metadata so string file becomes just ".dll". string hint is also null and so the code at the end gets executed to add the file string and so we get an entry of ".dll" in the referencedassemblies. Is this correct
foreach (MSBuild.BuildItem reference in this.buildProject.GetEvaluatedItemsByName(ProjectFileConstants.Reference))
{
string file = reference.GetMetadata(ProjectFileConstants.AssemblyName) + ".dll"; string hint = reference.GetMetadata(ProjectFileConstants.HintPath); if (!String.IsNullOrEmpty(hint)){
// probably relative to the current file...hint = hint.Replace(
Path.DirectorySeparatorChar, '/'); Url url = new Url(this.BaseURI, hint); string path = url.AbsoluteUrl;file = path;
}
if (!options.ReferencedAssemblies.Contains(file))options.ReferencedAssemblies.Add(file);
}

bug in ProjectNode.GetProjectOptions?
Arif Khan
It seems that it should be checking for Name instead of AssemblyName. In the C# project files I have seen there is no reference to AssemblyName in the ItemGroup's for the references. The Name metadata has the name without the dll extension. But in some cases in C# project files I have seen where the reference declaration in the project file did not include any metadata as in:
<Reference Include="System.Design" />
Can we modify the source code for Microsoft.VisualStudio.Package.Project, or is that a bad idea
JCroney
Hi Michael,
You are correct that the current behavior is incorrect. The code in question is pretty much dead code (we put information in that collection of strings, but we never use it). We will evaluate if it makes more sense to take it out or to fix it.
Thanks for pointing this out.
Rusty