-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Adding missing typeforward for Lazy<T,TMetadata> to S.CM.Composition #27337
Conversation
…odel.Composition Fixes #27299
This PR needs work. This wouldn't work for netfx. |
@@ -5,6 +5,8 @@ | |||
// Changes to this file must follow the http://aka.ms/api-review process. | |||
// ------------------------------------------------------------------------------ | |||
|
|||
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(destination: typeof(System.Lazy<,>))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are going to need to #ifdef this and include it only for netcoreapp, and for the other configurations you will need to include the API for Lazy<T,M>
in the ref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @weshaggard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry your comment about netfx through me off but after looking at the configurations more closely you don't need to #ifdef this you should always have the type-forward here.
As for the netfx build issue you need to fix it by adding a "_netfx" configuration in the src project for this library. However when you do that you will start having test failures because of https://github.com/dotnet/corefx/issues/25781 so you can either tackle that issue now or temporarily add a "_netfx" placeholder configuration in the test project as well.
While looking at the pkgproj I also noticed https://github.com/dotnet/corefx/blob/master/src/System.ComponentModel.Composition/pkg/System.ComponentModel.Composition.pkgproj#L13,L15 which isn't necessary and should be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming you'll add the _netfx
configurations to src and tests as we discussed offline this LGTM.
Looks like the binary serialization tests are failing to find the assembly. We many need to make some tweaks to those tests to fix them when running on netfx. @ViktorHofer any ideas on how those tests look for the assembly? |
The following two exceptions types are causing the FileNotFoundException:
both from System.ComponentModel.Composition. The test isn't doing anything fancy. I can repro the issue just by calling the ctor of one of the types: [Fact]
public void X()
{
var exception = new Exception();
var x = new System.ComponentModel.Composition.CompositionContractMismatchException("message", exception);
} In my environment there is no System.ComponentModel.Composition.dll in Building the project with netfx results in the following error:
|
This is expected since what we are doing in this change is stop producing it. That is what the
Again, this is expected, that is why we intentionally want to skip the build of this project on the netfx configuration. @ViktorHofer shouldn't your tests pick up the System.ComponentModel.Composition.dll on the GAC for netfx? |
There are a couple of issues with this change I'm making some tweaks locally and will push them once I validate. |
If you need me to step in again, just ping me. |
Thanks @ViktorHofer I've fixed the serialization tests. I'm just investigating the apicompat issues in all configurations. |
Thanks @weshaggard and @ViktorHofer. |
@maryamariyan I pushed a few commits which should fix some these issues. |
We still seem to be hitting some kind of apicompat issue. I didn't hit it on my rebuild locally but I'm trying a clean build to see if I can repro it. |
OK I pushed a new commit as I believe I found the reason the netstandard configuration wasn't building correctly. |
Since this assembly identity should match what is in .NET Framework we should use the ECMA key for it.
We don't want to bin-place System.ComponentModel.Composition from the Netstandard.Library package becasue we build it ourselves and we need it to be built as part of our all configurations build. While we could overwrite it in the output there are some logic in resolving contracts that prevent the correct configurations to be built when it is already present so we need to make sure the wrong one is no longer in the output.
213d81f
to
18b6bef
Compare
<ExcludeNetStandardRefs Include="System.ComponentModel.Composition" /> | ||
<NetStandardRefs | ||
Include="$(_NETStandardRefFolder)\*.dll" | ||
Exclude="@(ExcludeNetStandardRefs -> '$(_NETStandardRefFolder)\%(Identity).dll')" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wes couldn't you have just done
<Reference Include="@(NetStandardRefs)" Condition="'%(Identity)' != 'System.ComponentModel.Composition'">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but that doesn't scale as nicely if we need to add more to the list.
We are building a newer version of System.ComponentModel.Composition in our live builds and we need to exclude it from the netcorepp2.0 targeting pack otherwise we end up with the wrong one for our build.
Pushed one more change to fix the all configurations build for netcoreapp2.0. |
test Alpine.3.6 x64 Debug Build |
…lazy Adding missing typeforward for Lazy<T,TMetadata> to S.CM.Composition Commit migrated from dotnet/corefx@a188af6
Adding missing typeforward for Lazy<T,TMetadata> to System.ComponentModel.Composition
Fixes #27299