New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] Fix an issue where the 'ref' nuget is not found on windows. #1474

Merged
merged 1 commit into from Mar 27, 2018

Conversation

Projects
None yet
3 participants
@dellis1972
Contributor

dellis1972 commented Mar 26, 2018

The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using / as
path seperators. This is probably to be platform independent.

So in the project.assets.json we have a PackageName of

System.IO.Packaging/4.4.0

note the use of the /.

But our string comparision was using what ever path we had, on
windows that was \.

c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dll

So we never found the Library were we
looking for because system.io.packaging/4.4.0 != system.io.packaging\4.4.0.
We just got lucky that it worked on Mac because the path separator is /.

We also need to normalize the resulting full path
to match the system path separator, otherwise we end up looking for files like

c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dll

which do not work.

[Xamarin.Android.Build.Tasks] Fix an issue where the 'ref' nuget is n…
…ot found on windows.

The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using `/` as
path seperators. This is probably to be platform independent.
But our string comparision was using what ever path we had, on
windows that was `\`. So we never found the Library were we
looking for. We also need to normalize the resulting full path
to match the system path separator.
@jonathanpeppers

This comment has been minimized.

Contributor

jonathanpeppers commented Mar 26, 2018

I'm starting a Windows PR build for this one

@jonpryor jonpryor merged commit 43fa142 into xamarin:master Mar 27, 2018

5 checks passed

Ubuntu+xbuild PR Build Build finished. No test results found.
Details
VSTS: Xamarin.Android (Windows) VSTS build finished
Details
license/cla All CLA requirements met.
Details
macOS+msbuild PR Build Build finished. No test results found.
Details
macOS+xbuild PR Build Build finished. 37146 tests run, 895 skipped, 0 failed.
Details

jonpryor added a commit that referenced this pull request Mar 27, 2018

[Xamarin.Android.Build.Tasks] Find runtime NuGet on Windows. (#1474)
The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using `/` as
path seperators. This is probably to be platform independent.

So in the project.assets.json we have a PackageName of

    System.IO.Packaging/4.4.0

note the use of the `/`.

But our string comparision was using what ever path we had, on
windows that was `\`:

    c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dll

So we never found the Library were we
looking for because `system.io.packaging/4.4.0` != `system.io.packaging\4.4.0`.
We just got lucky that it worked on Mac because the path separator is `/`.

We also need to normalize the resulting full path
to match the system path separator, otherwise we end up looking for files like

    c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dll

which do not work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment