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

Why is LiteHtmlLib named LiteHtmlLib.dll? #4

Open
tig opened this issue Jan 22, 2020 · 1 comment
Open

Why is LiteHtmlLib named LiteHtmlLib.dll? #4

tig opened this issue Jan 22, 2020 · 1 comment

Comments

@tig
Copy link

tig commented Jan 22, 2020

Why not just name it litehtml.dll and avoid all this muck?

public class LibInterop : ILibInterop
    {

#if WINDOWS
        const string LiteHtmlLibFile = "LiteHtmlLib.dll";
        public const CharSet cs = CharSet.Unicode;
#else
        const string LiteHtmlLibFile = "litehtml";
        public const CharSet cs = CharSet.Ansi;
#endif

        const string LiteHtmlLibFile_x64 = "x64\\LiteHtmlLib.dll";
        const string LiteHtmlLibFile_x86 = "x86\\LiteHtmlLib.dll";

        public const CallingConvention cc = CallingConvention.Cdecl;

        readonly static Lazy<LibInterop> _instance = new Lazy<LibInterop>(() => new LibInterop());
        public static LibInterop Instance => _instance.Value;

        LibInterop()
        {
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                LoadLibrary(Environment.Is64BitProcess ? LiteHtmlLibFile_x64 : LiteHtmlLibFile_x86);
            }
        }

I've got things working groovy on Linux with my dotnet Core 3.1 app and I'd rather not have compilation conditionals. The easiest fix would be to just name the library htmllib.dll.

@zone117x
Copy link
Member

.NET Core 3 has substantially improved native assembly loading APIs. This lib should be updated to target netcoreapp3.0 and take advantage of those features. Feel free to submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants