Closed NightOwl888 closed 5 years ago
I don't think you want to hard code the XML namespaces. You'll never keep up. Just take the root namespace dynamically
Thanks. Come to think of it, I used this approach in another place, which I should do here as well.
$xml = [xml](Get-Content $tempFilePath)
$package.Name= ([string]$xml.package.metadata.id).Trim()
$package.Version = ([string]$xml.package.metadata.version).Trim()
Unfortunately, I don't have a way to update the package, but I will fix the PR so this isn't dependent upon the .nuspec
schema version.
I Will merge after my holidays
Verstuurd vanaf mijn iPhone
Op 25 jul. 2019 om 20:25 heeft Shad Storhaug notifications@github.com<mailto:notifications@github.com> het volgende geschreven:
This is a patch for #27https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frenevanosnabrugge%2Fvsts-promotepackage-task%2Fissues%2F27&data=02%7C01%7C%7Cd82d28c27a0545acb20708d7112d73ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636996759221270339&sdata=qmHJvaH47Aq4lxoefc9dHNZIzffXELf1huCUOh7tt4k%3D&reserved=0. Fix for Get-NuGetPackageMetadata function so it will function with either of these namespaces:
http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd
or
http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd
The logic was also changed a bit so more namespaces versions can be added easily to the $ns hash table, and they will be attempted in order from first to last.
You can view, comment on, or merge this pull request online at:
https://github.com/renevanosnabrugge/vsts-promotepackage-task/pull/28https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frenevanosnabrugge%2Fvsts-promotepackage-task%2Fpull%2F28&data=02%7C01%7C%7Cd82d28c27a0545acb20708d7112d73ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636996759221290354&sdata=hOZ754EQq4L9nTXJlszTyjdL2EiKw4E36ZQ3jQ7DkWA%3D&reserved=0
Commit Summary
File Changes
Patch Links:
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frenevanosnabrugge%2Fvsts-promotepackage-task%2Fpull%2F28%3Femail_source%3Dnotifications%26email_token%3DABOH2WXXS7N2JPXGZHJLC7DQBHVZDA5CNFSM4IG5I2V2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HBRQVUQ&data=02%7C01%7C%7Cd82d28c27a0545acb20708d7112d73ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636996759221350401&sdata=NKOF0gMHe0B0vwPYaVqX72ZB7IF1xDFQFcztpzR9O5E%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABOH2WXYZ3E756ZF4TQUVKDQBHVZDANCNFSM4IG5I2VQ&data=02%7C01%7C%7Cd82d28c27a0545acb20708d7112d73ff%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636996759221370423&sdata=7z0b6C7y7bHPA8CeJpxGin%2B7m%2FeOkOphBbomkgEZmC4%3D&reserved=0.
This PR has been superseded by #30.
This is a patch for #27. Fix for
Get-NuGetPackageMetadata
function so it will function with either of these namespaces:or
The logic was also changed a bit so more namespaces versions can be added easily to the
$ns
hash table, and they will be attempted in order from first to last.I have tested locally with one NuGet packages of each namespace and can confirm it will work with either one now.