netstandard2.0

This commit is contained in:
Timerix22 2022-11-18 03:02:11 +06:00
parent 37ce3fb33d
commit bef458bcdd
6 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net48</TargetFrameworks> <TargetFrameworks>net6.0;net48;netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>
@ -20,6 +20,10 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<Compile Remove="V30\**" /> <Compile Remove="V30\**" />
</ItemGroup> </ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net48</TargetFrameworks> <TargetFrameworks>net6.0;net48;netstandard2.0</TargetFrameworks>
<LangVersion>10</LangVersion> <LangVersion>10</LangVersion>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net48</TargetFrameworks> <TargetFrameworks>net6.0;net48;netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net48</TargetFrameworks> <TargetFrameworks>net6.0;net48;netstandard2.0</TargetFrameworks>
<LangVersion>10</LangVersion> <LangVersion>10</LangVersion>
<ImplicitUsings>false</ImplicitUsings> <ImplicitUsings>false</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>

View File

@ -28,7 +28,7 @@ public static class TestPInvoke
} }
[DllImport("kerep", CallingConvention = CallingConvention.Cdecl)] [DllImport("kerep", CallingConvention = CallingConvention.Cdecl)]
static extern void pinvoke_print([MarshalAs(UnmanagedType.LPUTF8Str)] string msg); static extern void pinvoke_print([MarshalAs(UnmanagedType.LPStr)] string msg);
public static void TestPrintf() public static void TestPrintf()
{ {
@ -38,7 +38,7 @@ public static class TestPInvoke
} }
[DllImport("kerep", CallingConvention = CallingConvention.Cdecl)] [DllImport("kerep", CallingConvention = CallingConvention.Cdecl)]
static extern unsafe void test_marshalling([MarshalAs(UnmanagedType.LPUTF8Str)] string text, out IntPtr kptr); static extern unsafe void test_marshalling([MarshalAs(UnmanagedType.LPStr)] string text, out IntPtr kptr);
public static unsafe void TestMarshalling() public static unsafe void TestMarshalling()
{ {

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net6.0;net48</TargetFrameworks> <TargetFrameworks>net6.0;net48;netstandard2.0</TargetFrameworks>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable> <Nullable>disable</Nullable>