Repository navigation
Fix to handle weird malformed portable-only libraries. - #2215
Conversation
The nuget parser handles folders in the form of:
{Identifier}{Version}-{Profile}
So the string: `portable-net45+win8+wp8` gets parsed to:
`.NETPortable,Version=v0.0,Profile=net45+win8+wp8`
The string: `portable45-net45+win8+wp8` gets parsed to:
`.NETPortable,Version=v4.5,Profile=net45+win8+wp8`
Both end up being "valid", but for portable frameworks, the version doesn't matter (the profile does).
The fix is to use a regex to strip out "portable-" and "portable{version}-" when doing platform matching.
Yes, I have seen this on a couple of other packages now. BTW, this behavior is still not documented. |
|
Yeah. Closest I've found to any sort of documentation on it is in the old v2 code here: Although, I guess one could argue that technically it is documented here: with the caveat that for portable frameworks, it should have the profile after: In any case, the following code in the NuGet library works: |
|
Alternatively, does it make sense to reference the NuGet DLLs and use their methods for parsing frameworks? I'm not well versed enough in the project to know if there was a conscious decision to not have NuGet as a dependency... |
|
That's a big nono. It's failing for million other reasons.
Am 03.04.2017 19:03 schrieb "onibait" <[email protected]>:
Alternatively, does it make sense to reference the NuGet DLLs and use their
methods for parsing frameworks? I'm not well versed enough in the project
to know if there was a conscious decision to not have NuGet as a
dependency...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2215 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADgNH9R6Lvg7DuFNxd7gHmdAUnW2NdVks5rsSZmgaJpZM4MwGM8>
.
|
Fix for issue #1645
The nuget parser handles strings in the form of:
{Identifier}{Version}-{Profile}
(see
NuGet.VersionUtility.ParseFrameworkName)So the string:
portable-net45+win8+wp8gets parsed to:.NETPortable,Version=v0.0,Profile=net45+win8+wp8The string:
portable45-net45+win8+wp8gets parsed to:.NETPortable,Version=v4.5,Profile=net45+win8+wp8Both end up being "valid", but for portable frameworks, the version doesn't matter (the profile does).
The fix is to use a regex to strip out "portable-" and "portable{version}-" when doing platform matching.
(note:
NuGet packseems to be using theportable45for whatever reason now)