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
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
"Description": "Provides read-only reflection on assemblies in an isolated context with support for assemblies that have different architectures and runtimes.",
1395
+
"CommonTypes": [
1396
+
"System.Reflection.MetadataLoadContext",
1397
+
"System.Reflection.MetadataAssemblyResolver",
1398
+
"System.Reflection.PathAssemblyResolver"
1399
+
]
1400
+
},
1392
1401
{
1393
1402
"Name": "System.Reflection.Primitives",
1394
1403
"Description": "Provides common enumerations for reflection-based libraries.",
@@ -2273,10 +2282,5 @@
2273
2282
"Name": "Microsoft.IO.Redist",
2274
2283
"Description": "Downlevel support package for System.IO classes.",
2275
2284
"CommonTypes": []
2276
-
},
2277
-
{
2278
-
"Name": "System.Reflection.MetataLoadContext",
2279
-
"Description": "Provides read-only reflection on assemblies in an isolated context with support for assemblies that have different architectures and runtimes.",
// Licensed to the .NET Foundation under one or more agreements.
2
+
// The .NET Foundation licenses this file to you under the MIT license.
3
+
// See the LICENSE file in the project root for more information.
4
+
5
+
// This file makes NetStandard Reflection's "subclassing" surface area look as much like NetCore as possible so the rest of the code can be written without #if's.
Copy file name to clipboardExpand all lines: src/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Interop.netstandard.cs
+16-59Lines changed: 16 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -2,65 +2,41 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
-
//
6
5
// This file makes NetStandard Reflection's "subclassing" surface area look as much like NetCore as possible so the rest of the code can be written without #if's.
7
-
//
8
6
9
7
namespaceSystem.Reflection.TypeLoading
10
8
{
11
-
//
12
-
// For code (usually shared with other repos) that have to interact with "Type" rather than "RoType", some handy extension methods that
13
-
// "add" the NetCore reflection apis back to NetStandard.
14
-
//
9
+
// For code that have to interact with "Type" rather than "RoType", some handy extension methods that "add" the NetCore reflection apis to NetStandard.
15
10
internalstaticclassNetCoreApiEmulators
16
11
{
17
-
#if netstandard
18
12
// On NetStandard, have to do with slower emulations.
// @TODO - https://github.com/dotnet/corefxlab/issues/2443: This should be fixed assuming https://github.com/dotnet/corefx/issues/31798 gets approved.
// Another layer of base types. For NetCore, these base types are all but empty. For NetStandard, these base types add the NetCore apis to NetStandard
43
-
// so code interacting with "RoTypes" and friends can happily code to the full NetCore surface area.
44
-
//
45
-
// On NetStandard and pre-2.2 NetCore, the TypeInfo constructor is not exposed so we cannot derive directly from TypeInfo.
46
-
// But we *can* derive from TypeDelegator which derives from TypeInfo. Since we're overriding (almost) every method,
47
-
// none of TypeDelegator's own methods get called (and the instance field it has for holding the "underlying Type" goes
48
-
// to waste.)
49
-
//
50
-
// For future platforms, RoTypeBase's base type should be changed back to TypeInfo. Deriving from TypeDelegator is a hack and
51
-
// causes us to waste an extra pointer-sized field per Type instance. It is also fragile as TypeDelegator could break us in the future
52
-
// by overriding more methods.
53
-
//
54
-
internalabstractclassLeveledTypeInfo:
55
-
#if netstandard
56
-
TypeDelegator
57
-
#else
58
-
TypeInfo
59
-
#endif
23
+
/// <summary>
24
+
/// Another layer of base types. For NetCore, these base types are all but empty. For NetStandard, these base types add the NetCore apis to NetStandard
25
+
/// so code interacting with "RoTypes" and friends can happily code to the full NetCore surface area.
26
+
///
27
+
/// On NetStandard (and pre-2.2 NetCore), the TypeInfo constructor is not exposed so we cannot derive directly from TypeInfo.
28
+
/// But we *can* derive from TypeDelegator which derives from TypeInfo. Since we're overriding (almost) every method,
29
+
/// none of TypeDelegator's own methods get called (and the instance field it has for holding the "underlying Type" goes
30
+
/// to waste.)
31
+
///
32
+
/// For future platforms, RoTypeBase's base type should be changed back to TypeInfo. Deriving from TypeDelegator is a hack and
33
+
/// causes us to waste an extra pointer-sized field per Type instance. It is also fragile as TypeDelegator could break us in the future
// This is an api that TypeDelegator overrides that it needn't have. Since RoType expects to fall through to System.Type's method, we have to reimplement
65
41
// System.Type's behavior here to avoid getting TypeDelegator's method.
// On NetStandard, AttributeType is declared non-virtually so apps are stuck calling the slow version that builds a constructor.
131
93
publicnewabstractTypeAttributeType{get;}
132
-
#else
133
-
// @todo: https://github.com/dotnet/corefxlab/issues/2460 Once the netcore build is building against a contract that declares AttributeType virtually,
134
-
// delete this line. We want RoCustomAttributeData to override the real AttributeType property.
0 commit comments