Skip to content

Commit 7bf7b28

Browse files
committed
Change framework to net47 for LPUTF8Str and switch to NXPorts
1 parent 1d59f73 commit 7bf7b28

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

netframework_loader/ClrLoader.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Reflection;
66
using System.Runtime.InteropServices;
7-
using RGiesecke.DllExport;
7+
using NXPorts.Attributes;
88

99
namespace ClrLoader
1010
{
@@ -44,9 +44,9 @@ public static IntPtr CreateAppDomain(
4444
[DllExport("pyclr_get_function", CallingConvention.Cdecl)]
4545
public static IntPtr GetFunction(
4646
IntPtr domain,
47-
[MarshalAs(UnmanagedType.LPUTF8Str)] string assemblyPath,
48-
[MarshalAs(UnmanagedType.LPUTF8Str)] string typeName,
49-
[MarshalAs(UnmanagedType.LPUTF8Str)] string function
47+
[MarshalAs(UnmanagedType.LPStr)] string assemblyPath,
48+
[MarshalAs(UnmanagedType.LPStr)] string typeName,
49+
[MarshalAs(UnmanagedType.LPStr)] string function
5050
)
5151
{
5252
try
@@ -90,4 +90,4 @@ static void Print(string s)
9090
}
9191
}
9292

93-
}
93+
}

netframework_loader/ClrLoader.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472</TargetFrameworks>
3+
<TargetFrameworks>net47</TargetFrameworks>
44
<Platforms>x64;x86</Platforms>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="UnmanagedExports.Repack.Upgrade" Version="1.2.1" />
8+
<PackageReference Include="NXports" Version="0.2.0-dev" />
9+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
12+
</PackageReference>
913
</ItemGroup>
1014

1115
<PropertyGroup Condition=" '$(Platform)' == 'x86'">

0 commit comments

Comments
 (0)