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

Transitive nuget dependencies are not handled with netstandard libraries #3949

Open
chamons opened this Issue Apr 17, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@chamons
Member

chamons commented Apr 17, 2018

A netstandard library that depends on nuget libraries will not be correctly resolved unless the XM or XI library in question also resolves those libraries independently.

Steps to Reproduce

  1. TestNugetProjectOverRefs.zip
  2. Build XM (TestNugetProjectOverRefs) project and run. Note runtime failure
  3. Build XI (TestNugetProjectOverRefs.iOS) project. It will fail in linking.

Expected Behavior

The XI and XM library to resolve the nuget required by the netstd library.

Actual Behavior

The "transitive" dependency of a dependency is not resolved correctly.

Environment

https://gist.github.com/chamons/a1fb655991f9bb749168b406e7544cce

Build Logs

https://gist.github.com/chamons/f66954a712614afa70058b63e909041a

Example Project (If Possible)

@spouliot

This comment has been minimized.

Show comment
Hide comment
@spouliot

spouliot Apr 17, 2018

Contributor
    Dependency "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed".
        Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

msbuild does not resolve it so it's never given to mmp (or mtouch)

Contributor

spouliot commented Apr 17, 2018

    Dependency "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed".
        Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

msbuild does not resolve it so it's never given to mmp (or mtouch)

@chamons

This comment has been minimized.

Show comment
Hide comment
@chamons

chamons Apr 17, 2018

Member

Well then it's an msbuild issue apparently. This "should" work I believe. @jstedfast @radical ?

Member

chamons commented Apr 17, 2018

Well then it's an msbuild issue apparently. This "should" work I believe. @jstedfast @radical ?

@mandel-macaque mandel-macaque added this to the Future milestone Apr 18, 2018

@chances

This comment has been minimized.

Show comment
Hide comment
@chances

chances Jun 9, 2018

Any update on this issue?

Should I just add my transitive dependencies as references in my root project as a workaround? Doing this works with my NuGet dependencies.

chances commented Jun 9, 2018

Any update on this issue?

Should I just add my transitive dependencies as references in my root project as a workaround? Doing this works with my NuGet dependencies.

@chamons

This comment has been minimized.

Show comment
Hide comment
@chamons

chamons Jun 11, 2018

Member

@chances - I believe that is the best work around until this is sorted out. There is no update currently.

Member

chamons commented Jun 11, 2018

@chances - I believe that is the best work around until this is sorted out. There is no update currently.

@rolfbjarne

This comment has been minimized.

Show comment
Hide comment
@rolfbjarne

rolfbjarne Sep 11, 2018

Member

So after some investigation (for a developer community issue), it seems this is kind of the expected behavior: dependencies of .netstandard projects don't flow to the referencing ("old-style") project. This behavior is explained in dotnet/sdk#901.

The fix seems to be to migrate your main project to a PackageReference project, which is fairly simple: https://stackoverflow.com/a/49266856/183422.

For extensions, this also needs an additional fix (the fix for #4237), which should be released to stable together with our iOS 12 supported release fairly soon.

Leaving open so that we can write tests (can't do it quite yet, since we need to build/test with msbuild, which requires 2018-06 to get a version that supports our needs).

Member

rolfbjarne commented Sep 11, 2018

So after some investigation (for a developer community issue), it seems this is kind of the expected behavior: dependencies of .netstandard projects don't flow to the referencing ("old-style") project. This behavior is explained in dotnet/sdk#901.

The fix seems to be to migrate your main project to a PackageReference project, which is fairly simple: https://stackoverflow.com/a/49266856/183422.

For extensions, this also needs an additional fix (the fix for #4237), which should be released to stable together with our iOS 12 supported release fairly soon.

Leaving open so that we can write tests (can't do it quite yet, since we need to build/test with msbuild, which requires 2018-06 to get a version that supports our needs).

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