Calls to comctl32.dll succeed in .NET 4.8, but fail in .NET 5 with System.EntryPointNotFoundException
See original GitHub issue- .NET Core Version: 5.0.100 and 3.1.404
- Windows version: Windows 10 (18363.1139)
- Does the bug reproduce also in WPF for .NET Framework 4.8?: No
- Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc…)? No
Problem description:
Calls to comctl32.dll
succeed in .NET Framework 4.8, but fail in .NET 5 and also in .NET Core 3.1 with a System.EntryPointNotFoundException
.
e.g.
[DllImport("comctl32.dll", PreserveSig = false)]
private static extern void TaskDialogIndirect([In] ref TaskDialogConfig pTaskConfig, out int pnButton,
out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);
// ...
var config = new TaskDialogConfig
{
pszWindowTitle = "Task dialog title",
pszMainInstruction = "Task dialog main instruction",
dwCommonButtons = TaskDialogCommonButtonFlags.OkButton | TaskDialogCommonButtonFlags.CancelButton,
// ...
};
using (new ComCtlv6ActivationContext(enable: true))
{
TaskDialogIndirect(ref config, out _, out _, out _);
}
Actual behavior:
System.EntryPointNotFoundException: Unable to find an entry point named 'TaskDialogIndirect' in DLL 'comctl32.dll'.
at TaskDialogApi.TaskDialog.TaskDialogIndirect(TaskDialogConfig& pTaskConfig, Int32& pnButton, Int32& pnRadioButton, Boolean& pfVerificationFlagChecked)
Expected behavior:
Display the Task Dialog requested
Minimal repro:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:28 (23 by maintainers)
Top Results From Across the Web
Calls to comctl32.dll succeed in .NET 4.8, but fail in . ...
NET Core Version: 5.0.100 and 3.1.404 Windows version: Windows 10 ... System.EntryPointNotFoundException: Unable to find an entry point ...
Read more >EntryPointNotFoundException Class (System)
The exception that is thrown when an attempt to load a class fails due to the absence of an entry method.
Read more >Why do I get an EntryPointNotFoundException error when ...
Preliminary note 2: The main program code in .NET Core and .NET resides in a dll file which needs to be executed using...
Read more >ookii-dialogs-wpf
Calls to comctl32.dll succeed in .NET 4.8, but fail in .NET 5 with System.EntryPointNotFoundException. Release History. Click on the ...
Read more >Solved: comctl32.dll error during boot up
I just installed FrontPage 2000 on my PC, and when prompted to reboot to finish installation, my PC got as far as bringing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have no idea who added the manifest in .NET Framework, I just want to clarify that the fact that it lives next to
mscorlib
is probably not very telling. There are more than 400 files next tomscorlib
in .NET Framework…That said I think this is something which should ideally work “seamlessly” whenever “Windows Dektop” is asked for. For example, it might make sense to automatically include this in the application manifest for any app which targets
net5-windows
(ornet6-windows
).Well - it’s already in runtime repo right now 😉 Depending on the design it might not belong there. For example if we were to implement the solution where windows apps get different manifest by default, it would probably belong to the SDK repo.
But I think there’s a discussion to have:
XPTheme.manifest
in the shared framework (next to coreclr.dll and other “root” assemblies). This doesn’t feel right to be honest, since we would have to do this for all apps, not just net5-windows apps - any app on windows regardless of its purpose would get that file.