Update GetDependencyInfo.cs
This commit is contained in:
parent
8fa51f49e8
commit
1dc073731d
1 changed files with 14 additions and 14 deletions
|
@ -33,21 +33,21 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
try
|
||||
{
|
||||
using Stream file = new HttpClient().GetStreamAsync(
|
||||
$"https://raw.githubusercontent.com/dotnet/installer/{DotnetInstallerCommit}/eng/Version.Details.xml")
|
||||
.Result;
|
||||
|
||||
XDocument document = XDocument.Load(file);
|
||||
XElement dependency = document
|
||||
.Element("Dependencies")?
|
||||
.Element("ProductDependencies")?
|
||||
.Elements("Dependency")
|
||||
.FirstOrDefault(d => DependencyName.Equals(d.Attribute("Name")?.Value));
|
||||
|
||||
if (dependency != null)
|
||||
string versionsXmlUrl = $"https://raw.githubusercontent.com/dotnet/installer/{DotnetInstallerCommit}/eng/Version.Details.xml";
|
||||
using (Stream file = new HttpClient().GetStreamAsync(versionsXmlUrl).Result)
|
||||
{
|
||||
DependencyVersion = dependency.Attribute("Version")?.Value;
|
||||
DependencyCommit = dependency.Element("Sha")?.Value;
|
||||
XDocument document = XDocument.Load(file);
|
||||
XElement dependency = document
|
||||
.Element("Dependencies")?
|
||||
.Element("ProductDependencies")?
|
||||
.Elements("Dependency")
|
||||
.FirstOrDefault(d => DependencyName.Equals(d.Attribute("Name")?.Value));
|
||||
|
||||
if (dependency != null)
|
||||
{
|
||||
DependencyVersion = dependency.Attribute("Version")?.Value;
|
||||
DependencyCommit = dependency.Element("Sha")?.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Loading…
Add table
Reference in a new issue