Skip to content

Commit 2d0fd8e

Browse files
authored
Manually add API that isn't present in the contract assembly (#873)
... but that is required by the compiler (base type abstract member). For more details see discussion in dotnet/source-build#4000
1 parent 1b84747 commit 2d0fd8e

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

src/referencePackages/src/system.runtime.interopservices/4.3.0/System.Runtime.InteropServices.4.3.0.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
</PropertyGroup>
77

88
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
9+
<!-- Needs additional APIs that don't exist in the contract. -->
10+
<Compile Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.Manual.cs" />
11+
912
<PackageReference Include="Microsoft.NETCore.Platforms" Version="1.1.0" />
1013
<PackageReference Include="Microsoft.NETCore.Targets" Version="1.1.0" />
1114
<PackageReference Include="System.Reflection" Version="4.3.0" />
@@ -40,6 +43,9 @@
4043
</ItemGroup>
4144

4245
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
46+
<!-- Needs additional APIs that don't exist in the contract. -->
47+
<Compile Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.Manual.cs" />
48+
4349
<PackageReference Include="Microsoft.NETCore.Platforms" Version="1.1.0" />
4450
<PackageReference Include="Microsoft.NETCore.Targets" Version="1.1.0" />
4551
<PackageReference Include="System.Reflection" Version="4.3.0" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// 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+
// Changes to this file must follow the http://aka.ms/api-review process.
6+
// ------------------------------------------------------------------------------
7+
8+
// See https://github.com/dotnet/source-build/issues/4000 for why this is necessary.
9+
10+
namespace System.Runtime.InteropServices
11+
{
12+
public partial class ComAwareEventInfo : Reflection.EventInfo
13+
{
14+
public override Reflection.MethodInfo GetAddMethod(bool nonPublic) { throw null; }
15+
16+
public override Reflection.MethodInfo GetRaiseMethod(bool nonPublic) { throw null; }
17+
18+
public override Reflection.MethodInfo GetRemoveMethod(bool nonPublic) { throw null; }
19+
}
20+
}

src/referencePackages/src/system.runtime.interopservices/4.3.0/ref/netcoreapp1.1/System.Runtime.InteropServices.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ public ComAwareEventInfo(Type type, string eventName) { }
142142
public override void AddEventHandler(object target, Delegate handler) { }
143143

144144
public override void RemoveEventHandler(object target, Delegate handler) { }
145-
146-
public override Reflection.MethodInfo GetAddMethod(bool nonPublic) { throw null; }
147-
148-
public override Reflection.MethodInfo GetRaiseMethod(bool nonPublic) { throw null; }
149-
150-
public override Reflection.MethodInfo GetRemoveMethod(bool nonPublic) { throw null; }
151145
}
152146

153147
[AttributeUsage(AttributeTargets.Class, Inherited = false)]

src/referencePackages/src/system.runtime.interopservices/4.3.0/ref/netstandard1.5/System.Runtime.InteropServices.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ public ComAwareEventInfo(Type type, string eventName) { }
142142
public override void AddEventHandler(object target, Delegate handler) { }
143143

144144
public override void RemoveEventHandler(object target, Delegate handler) { }
145-
146-
public override Reflection.MethodInfo GetAddMethod(bool nonPublic) { throw null; }
147-
148-
public override Reflection.MethodInfo GetRaiseMethod(bool nonPublic) { throw null; }
149-
150-
public override Reflection.MethodInfo GetRemoveMethod(bool nonPublic) { throw null; }
151145
}
152146

153147
[AttributeUsage(AttributeTargets.Class, Inherited = false)]

0 commit comments

Comments
 (0)