File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Castle.Core.Tests/Core.Tests/Logging Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,12 @@ public void Reset()
4949
5050 private void AssertAdmin ( )
5151 {
52- if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
52+ #if NETCOREAPP2_0_OR_GREATER
53+ bool isWindows = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ;
54+ #else
55+ bool isWindows = ! RunningOnMono ( ) ;
56+ #endif
57+ if ( isWindows )
5358 {
5459 WindowsPrincipal windowsPrincipal = new WindowsPrincipal ( WindowsIdentity . GetCurrent ( ) ) ;
5560 try
Original file line number Diff line number Diff line change 3030
3131 <ItemGroup Condition =" '$(TargetFramework)'=='net462'" >
3232 <Reference Include =" System.Configuration" />
33- <PackageReference Include =" System.Runtime.InteropServices.RuntimeInformation" Version =" 4.3.0" />
3433 </ItemGroup >
3534
3635 <ItemGroup Condition =" '$(TargetFramework)'=='netstandard2.0'" >
Original file line number Diff line number Diff line change @@ -556,7 +556,13 @@ public virtual object CreateInterfaceProxyWithTargetInterface(Type interfaceToPr
556556
557557 if ( target != null )
558558 {
559- if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) && Marshal . IsComObject ( target ) )
559+ #if NET6_0_OR_GREATER
560+ bool doComHandling = OperatingSystem . IsWindows ( ) ;
561+ #else
562+ bool doComHandling = true ;
563+ #endif
564+
565+ if ( doComHandling && Marshal . IsComObject ( target ) )
560566 {
561567 var interfaceId = interfaceToProxy . GUID ;
562568 if ( interfaceId != Guid . Empty )
You can’t perform that action at this time.
0 commit comments