Skip to content
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

Microsoft.NETCore.UniversalWindowsPlatform is missing some packages after "exclude": "compile" updates #17933

Closed
ericstj opened this issue Jul 26, 2016 · 9 comments
Assignees
Milestone

Comments

@ericstj
Copy link
Member

ericstj commented Jul 26, 2016

We updated all packages to hide their implementation dependencies with "exclude": "compile". We did this because implementation dependencies change regularly and aren't seen as part of the compatibility contract of a package. To ensure that folks don't rely on our packages for their implementation dependencies we use "exclude": "compile" in the packages.

This transition caused at some package to be excluded entirely from the UWP meta-package since they were only referenced transitively. We should consider adding these back unless we specifically want to keep them out of the default reference set. /cc @weshaggard @terrajobst

The dropped references are:

  • System.Collections.NonGeneric
  • System.Collections.Specialized
  • System.Threading.Overlapped
  • System.Xml.XmlDocument

Workaround

For folks that hit missing types from one of these packages after upgrading to Microsoft.NETCore.UniversalWindowsPlatform they can reference the packages directly as follows.

    "System.Collections.NonGeneric": "4.0.1",
    "System.Collections.Specialized": "4.0.1",
    "System.Threading.Overlapped": "4.0.1",
    "System.Xml.XmlDocument": "4.0.1"
@ericstj ericstj self-assigned this Jul 26, 2016
@weshaggard
Copy link
Member

I would simply hold off and just include them when we rev all them as part of the api work.

@ericstj
Copy link
Member Author

ericstj commented Jul 27, 2016

@johntester000010 I think you're just dealing with the designer using stale references I downloaded your sample and loaded it and it worked file for me. The designer loaded for both MainPage and Tester without errors.

@ericstj
Copy link
Member Author

ericstj commented Jul 27, 2016

Indeed I can reproduce.

BadImageFormatException: Could not load file or assembly 'System.Collections.NonGeneric, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)

The designer isn't pulling out the correct asset from the package. It's supposed to be using the output of RuntimeImplementationProjectOutputGroup which are actual runtime assemblies, but instead it seems to be using the references passed to the compiler which are reference assemblies.

I enabled design time tracing and added some logging to RuntimeImplementationProjectOutputGroup and confirm that this is passing the right dll (implementation, not reference assembly):

<userprofile>\.nuget\packages\System.Collections.NonGeneric\4.0.1\lib\netstandard1.3\System.Collections.NonGeneric.dll

@danmoseley
Copy link
Member

@joperezr I assume this is still relevant.

@ericstj
Copy link
Member Author

ericstj commented Mar 1, 2017

I believe @zamont is fixing this.

@ericstj
Copy link
Member Author

ericstj commented Mar 1, 2017

@joperezr let's make sure that these libraries are all included in the ref set for latest UWP flat package.

@zacharycmontoya
Copy link

Commit dotnet/core-setup@42121ee commits this fix to the dotnet/core-setup:master branch. I'm not sure if the UWP MP package gets produced off the master branch, but if it does, then this fix will be in the frequently-built prerelease packages of Microsoft.NETCore.UniversalWindowsPlatform on myget.

@joperezr
Copy link
Member

joperezr commented Mar 3, 2017

@joperezr let's make sure that these libraries are all included in the ref set for latest UWP flat package.

Looks like they are all there except for System.Xml.XmlDocument. I'll send up a PR to fix this.

@zacharycmontoya
Copy link

Fixed by dotnet/core-setup#1649

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants
@danmoseley @ericstj @weshaggard @msftgits @zacharycmontoya @joperezr and others