You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Build as a netstandard 2.0 package. (reference assembly will build against netstandard.dll)
2. Ensure TypeBuilder inherits from Type. This is a small breaking change that allows us to build the reference assembly using the normal build path despite TypeInfo's constructor not being public out of netstandard.dll.
3. Because of this breaking change, we must also bump the contract's major version number.
4. Make sure APIs correctly throw PNSE for AOT platforms that do not support Emit such as Unity, Xamarin/mono, UWP, UWP-AOT, etc
5. Update the package description to document the PNSEs on AOT platforms
Ensure TypeBuilder inherits from Type. This is a small breaking change that allows us to build the reference assembly using the normal build path despite TypeInfo's constructor not being public out of netstandard.dll.
Currently TypeBuilder does inherit from Type in the contract\ref, but not the implementation (it inherits from TypeInfo).
Because of this breaking change, we must also bump the contract's major version number.
There is no breaking change (TypeBuilder inherits from Type)
Make sure APIs correctly throw PNSE for AOT platforms that do not support Emit such as Unity, Xamarin/mono, UWP, UWP-AOT, etc
Over time any dependent frameworks\platforms will take on the newer bits and should have the correct semantics. However, for the shorter term and\or for those that are using older or servicing branches we need to determine if we need to update the servicing branch(es).
@zamont @tommcdon from UWP side, do you want an updated service branch(es) that would contain the "correct" semantics (throwing PNSE) for System.Reflection.Emit?
@tommcdon I assume we also want to throw PNSE for System.Reflection.Emit.dll in both UWP debug mode and release (UWP-AOT) mode. Note that today debug mode works.
throw PNSE for System.Reflection.Emit.dll in both UWP debug mode
That does not work. Number of other libraries (like serializers) are implemented differently for regular (debug) vs. aot (release) flavor. The regular debug flavor uses Reflection.Emit. If you start throwing from Reflection.Emit contracts in debug, these libraries will break.
It is unfortunate that there are dependencies on the debug\non-aot semantics. I was planning to add TargetsUap to the S.R.Emit.csproj and S.R.Emit.Lightweight.csproj to generate the PNSE, but now will hold off unless I hear otherwise.
Closing. One of the other items listed was to "Update the package description to document the PNSEs on AOT platforms" however we don't do that on any other packages that I saw.
@steveharter: Sorry for disturbing the peace of this closed issue, but could you please clarify something about the following:
[X] 1. Build as a netstandard 2.0 package. (reference assembly will build against netstandard.dll)
When I install the S.R.E package (4.6.0-preview3.19128.7) into a a netstandard2.0 library project, one of the things that get installed along with it is Microsoft.NETCore.Targets. I'm a little worried about seeing the ".NET Core" bit there: There's no guarantee that users of my library are going to target .NET Core. What is the meaning and what are the implications of that dependency?
@stakx I was unable to repro the Microsoft.NETCore.Targets file getting created. Where was it created?
However I do see a hidden [myprojectname].csproj.nuget.g.targets get created in the \obj folder. I'm using preview version of SDK (3.0.100-preview-009812)
It's harmless and can be ignored. It contributes nothing to the build and is only used by nuget during restore if you happen to use supports clauses in a project.json. I don't even think that concept survived to the MSBuild representation of packagereference.
I wish we could. Unfortunately NuGet doesn't provide a way to rename a package (you cannot declare one package as replacing the old package) otherwise we would have done this. Here's an ask for this feature from NuGet: dotnet/aspnetcore#1222,
Activity
joperezr commentedon Aug 13, 2018
Unassigning from me since my part of the work was finished by @ericstj here: dotnet/corefx#30741
joshfree commentedon Nov 7, 2018
@steveharter we should get this into 3.0 soon to ensure there's no unintended fallout from this change.
steveharter commentedon Dec 11, 2018
I added checkboxes to the original description.
Currently TypeBuilder does inherit from Type in the contract\ref, but not the implementation (it inherits from TypeInfo).
There is no breaking change (TypeBuilder inherits from Type)
Over time any dependent frameworks\platforms will take on the newer bits and should have the correct semantics. However, for the shorter term and\or for those that are using older or servicing branches we need to determine if we need to update the servicing branch(es).
steveharter commentedon Dec 11, 2018
@zamont @tommcdon from UWP side, do you want an updated service branch(es) that would contain the "correct" semantics (throwing PNSE) for System.Reflection.Emit?
tommcdon commentedon Dec 12, 2018
@steveharter For UWP no need to backport the correctness fix.
steveharter commentedon Dec 12, 2018
@tommcdon I assume we also want to throw PNSE for System.Reflection.Emit.dll in both UWP debug mode and release (UWP-AOT) mode. Note that today debug mode works.
tommcdon commentedon Dec 12, 2018
@steveharter Correct - we should try to provide a consistent experience between Debug/Release mode debugging
jkotas commentedon Dec 13, 2018
That does not work. Number of other libraries (like serializers) are implemented differently for regular (debug) vs. aot (release) flavor. The regular debug flavor uses Reflection.Emit. If you start throwing from Reflection.Emit contracts in debug, these libraries will break.
steveharter commentedon Dec 14, 2018
It is unfortunate that there are dependencies on the debug\non-aot semantics. I was planning to add
TargetsUapto the S.R.Emit.csproj and S.R.Emit.Lightweight.csproj to generate the PNSE, but now will hold off unless I hear otherwise.jkotas commentedon Dec 14, 2018
I think this issue can be closed.
steveharter commentedon Dec 14, 2018
Closing. One of the other items listed was to "Update the package description to document the PNSEs on AOT platforms" however we don't do that on any other packages that I saw.
stakx commentedon Mar 12, 2019
@steveharter: Sorry for disturbing the peace of this closed issue, but could you please clarify something about the following:
When I install the S.R.E package (4.6.0-preview3.19128.7) into a a
netstandard2.0library project, one of the things that get installed along with it isMicrosoft.NETCore.Targets. I'm a little worried about seeing the ".NET Core" bit there: There's no guarantee that users of my library are going to target .NET Core. What is the meaning and what are the implications of that dependency?steveharter commentedon Apr 4, 2019
@stakx I was unable to repro the
Microsoft.NETCore.Targetsfile getting created. Where was it created?However I do see a hidden
[myprojectname].csproj.nuget.g.targetsget created in the \obj folder. I'm using preview version of SDK (3.0.100-preview-009812)stakx commentedon Apr 4, 2019
@steveharter: The name I mentioned doesn't refer to an MSBuild
.targetsfile, but to a NuGet package dependency.ericstj commentedon Apr 4, 2019
Microsoft.NETCore.Targets is a transitive dependency of Ref.Emit It's actually not for .NETCore, it was just the common naming we were using back in 1.0. Back then it contained the "targets" supported by nuget-based portable libraries. These implemented the "supports" checks done by nuget, buy describing what tfm and RID set a support clause mapped to. You can see that content here: https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Targets/runtime.json.
It's harmless and can be ignored. It contributes nothing to the build and is only used by nuget during restore if you happen to use supports clauses in a project.json. I don't even think that concept survived to the MSBuild representation of packagereference.
stakx commentedon Apr 4, 2019
@ericstj: Thank you for the explanation!
(It might be good to rename that package then, so things look a little less suspicious from the end user's perspective.)
ericstj commentedon Apr 4, 2019
I wish we could. Unfortunately NuGet doesn't provide a way to rename a package (you cannot declare one package as replacing the old package) otherwise we would have done this. Here's an ask for this feature from NuGet: dotnet/aspnetcore#1222,
We're really only bringing the reference along to replace the old 1.0 version should it be pulled into the dependency graph. Back in 1.0 this package also contained the runtime-package-associations for our RID split packages, those are problematic since they would bring in the 1.0 runtime packages. More info here: https://github.com/dotnet/corefx/issues/18088.