public override IEnumerable <ReferenceProjectItem> ResolveAssemblyReferences(CancellationToken cancellationToken) { ReferenceProjectItem[] additionalItems = { new ReferenceProjectItem(this, "mscorlib"), new ReferenceProjectItem(this, "Microsoft.VisualBasic"), }; return(MSBuildInternals.ResolveAssemblyReferences(this, additionalItems)); }
/// <summary> /// run this method with a .net 3.5 and .net 4.0 project to generate the table above. /// </summary> void CreateReferenceToFrameworkTable() { LoggingService.Warn("Running CreateReferenceToFrameworkTable()"); MSBuildBasedProject project = selectDialog.ConfigureProject as MSBuildBasedProject; if (project == null) { return; } var redistNameToRequiredFramework = new Dictionary <string, string> { { "Framework", null }, { "Microsoft-Windows-CLRCoreComp", null }, { "Microsoft.VisualStudio.Primary.Interop.Assemblies.8.0", null }, { "Microsoft-WinFX-Runtime", "3.0" }, { "Microsoft-Windows-CLRCoreComp.3.0", "3.0" }, { "Microsoft-Windows-CLRCoreComp-v3.5", "3.5" }, { "Microsoft-Windows-CLRCoreComp.4.0", "4.0" }, }; using (StreamWriter w = new StreamWriter("c:\\temp\\references.txt")) { List <ReferenceProjectItem> referenceItems = new List <ReferenceProjectItem>(); WorkbenchSingleton.SafeThreadCall( delegate { foreach (ListViewItem item in fullItemList) { referenceItems.Add(new ReferenceProjectItem(project, item.Tag.ToString())); } }); MSBuildInternals.ResolveAssemblyReferences(project, referenceItems.ToArray()); foreach (ReferenceProjectItem rpi in referenceItems) { if (string.IsNullOrEmpty(rpi.Redist)) { continue; } if (!redistNameToRequiredFramework.ContainsKey(rpi.Redist)) { LoggingService.Error("unknown redist: " + rpi.Redist); } else if (redistNameToRequiredFramework[rpi.Redist] != null) { w.Write("\t\t\t{ \""); w.Write(rpi.Include); w.Write("\", \""); w.Write(redistNameToRequiredFramework[rpi.Redist]); w.WriteLine("\" },"); } } } }
public override IEnumerable <ReferenceProjectItem> ResolveAssemblyReferences(CancellationToken cancellationToken) { ReferenceProjectItem[] additionalReferences = { new ReferenceProjectItem(this, "mscorlib"), new ReferenceProjectItem(this, "System") }; ReferenceProjectItem[] booReferences = { new ReferenceProjectItem(this, "Boo.Lang") { FileName = typeof(Boo.Lang.Builtins).Assembly.Location }, new ReferenceProjectItem(this, "Boo.Extensions") { FileName = typeof(Boo.Lang.Extensions.PropertyAttribute).Assembly.Location } }; return(MSBuildInternals.ResolveAssemblyReferences(this, additionalReferences).Concat(booReferences)); }
void ResolveVersionsWorker() { MSBuildBasedProject project = selectDialog.ConfigureProject as MSBuildBasedProject; if (project == null) { return; } List <ListViewItem> itemsToResolveVersion = new List <ListViewItem>(); List <ReferenceProjectItem> referenceItems = new List <ReferenceProjectItem>(); WorkbenchSingleton.SafeThreadCall( delegate { foreach (ListViewItem item in shortItemList) { if (item.SubItems[1].Text.Contains("/")) { itemsToResolveVersion.Add(item); referenceItems.Add(new ReferenceProjectItem(project, item.Text)); } } }); MSBuildInternals.ResolveAssemblyReferences(project, referenceItems.ToArray()); WorkbenchSingleton.SafeThreadAsyncCall( delegate { if (IsDisposed) { return; } for (int i = 0; i < itemsToResolveVersion.Count; i++) { if (referenceItems[i].Version != null) { itemsToResolveVersion[i].SubItems[1].Text = referenceItems[i].Version.ToString(); } } }); }