chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 279 forks source link

Runtime error because of invalid DLL Import #264

Closed donotcodeit closed 3 years ago

donotcodeit commented 3 years ago

.\src\Chromely\NativeHosts\WinHost\Interop\Interop.OSVersion contains imports which is not actually exist in a specified DLL:

            [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
            public static extern bool IsWindows7OrGreater();

            [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
            public static extern bool IsWindows8OrGreater();

            [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
            public static extern bool IsWindows8Point1OrGreater();

            [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
            public static extern bool IsWindows10OrGreater();

Please look at this SO page for details: https://stackoverflow.com/questions/31550444/c-sharp-how-to-use-the-new-version-helper-api

mattkol commented 3 years ago

@donotcodeit interesting ...

Is it possible you provide a PR for this? It will be a bit difficult to confirm at my end if I am not actually seeing the same errors.

Thanks.

donotcodeit commented 3 years ago

I will be busy on #266, because is top priority for product that I maintain, and try to provide PR for its fixes.

It will be great if Chromely team will make fix for this #264 issue and for #265, while I'm working on #266...

There's minimum repro:

mattkol commented 3 years ago

@donotcodeit related functionality removed - https://github.com/chromelyapps/Chromely/issues/266#issuecomment-741685426

Please let me know if we need to close this now. Thanks.

donotcodeit commented 3 years ago

@mattkol since removing DWM approach this issue is not actual anymore. Thanks.