Is .Net Standard 2.0 supported?
See original GitHub issueHello I’m using VS 2019, I created a new .Net Standard Class Library C# project targeting netstandard2.0.
I installed DllExport: dotnet add package DllExport --version 1.7.4
And wrote a small code:
using CoreAudio;
using System;
using System.Collections.Generic;
using static System.Console;
using RGiesecke.DllExport;
using System.Runtime.InteropServices;
namespace MyTests
{
public class ExportProgram
{
//[DllExport]
[DllExport("Init", CallingConvention.StdCall)]
public static string TestExport()
{
return "999";
}
}
}
I get this warning during the build: warn : Package ‘UnmanagedExports 1.2.7’ was restored using ‘.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8’ instead of the project target framework ‘.NETStandard,Version=v2.0’. This package may not be fully compatible with your project.
I can’t see the functions on the dll using dumbin /exports
.
But on the other hand, .Net Framework has no issue and DllExport works just fine, I can see the exported function using dumpbin /exports
and I can call it using rundll32
. And I used the code below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CoreAudio;
using static System.Console;
using RGiesecke.DllExport;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace MyTests
{
public class ExportProgram
{
//[DllExport]
[DllExport("Init", CallingConvention.StdCall)]
public static string TestExport()
{
MessageBox.Show("Hello, world, from C#!");
return "999";
}
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hello,
Yes .NET Standard 2.0 is supported https://github.com/3F/DllExport/wiki/.Net-Core
Please follow the information from the issue template and provide requirement data to diag your case.
Please also read https://github.com/3F/DllExport/wiki/Quick-start
> “warn : Package ‘UnmanagedExports 1.2.7’ was restored using…”
Also make sure you only use DllExport tool and not UnmanagedExports.1.2.7 https://github.com/3F/DllExport/issues/196#issuecomment-996028881
You need to edit it manually if your project file is corrupted somehow or simply try to delete everything before continue. Then follow steps from the wiki.
n. I may be slow to respond due to many reasons beyond my control, sorry
Hello,
Yes .NET Standard 2.0 is supported https://github.com/3F/DllExport/wiki/.Net-Core
Please follow information from the issue template and provide requirement data to diag your case.
Please also read https://github.com/3F/DllExport/wiki/Quick-start
Also make sure you only use DllExport and not UnmanagedExports.1.2.7 https://github.com/3F/DllExport/issues/196#issuecomment-996028881
You need to edit it manually if your project file is corrupted somehow or simply try to delete everything. Then follow steps from the wiki.
n. I can be very slow for many reason in response, sorry