Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add net6.0 as a target framework #616

Merged
merged 15 commits into from May 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Castle.Core/Castle.Core.csproj
Expand Up @@ -38,6 +38,7 @@

<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="System.Configuration" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
Expand Down
4 changes: 1 addition & 3 deletions src/Castle.Core/DynamicProxy/ProxyGenerator.cs
Expand Up @@ -16,14 +16,12 @@ namespace Castle.DynamicProxy
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;

using Castle.Core.Internal;
using Castle.Core.Logging;
using Castle.DynamicProxy.Generators;

/// <summary>
/// Provides proxy objects for classes and interfaces.
Expand Down Expand Up @@ -558,7 +556,7 @@ public object CreateInterfaceProxyWithTarget(Type interfaceToProxy, object targe

if (target != null)
{
if (Marshal.IsComObject(target))
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Marshal.IsComObject(target))
jonorossi marked this conversation as resolved.
Show resolved Hide resolved
{
var interfaceId = interfaceToProxy.GUID;
if (interfaceId != Guid.Empty)
Expand Down