Skip to content

[MAUI] USER32.dll not found on Mac #204

@dtoth1

Description

@dtoth1

Describe the bug

Tried to run the sample code (unchanged) to check the notifyicon behavior, but it throws an error. This issue is encountered also in my project where the NotifyIcon is used as NuGet package.

Error:

System.DllNotFoundException: USER32.dll
at H.NotifyIcon.Core.MessageWindow.Create() in /Users/dtoth/Downloads/H.NotifyIcon-master/src/libs/H.NotifyIcon/Core/MessageWindow.cs:line 125
at H.NotifyIcon.Core.TrayIcon.Create() in /Users/dtoth/Downloads/H.NotifyIcon-master/src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 309
at H.NotifyIcon.TaskbarIcon.ForceCreate(Boolean enablesEfficiencyMode) in /Users/dtoth/Downloads/H.NotifyIcon-master/src/libs/H.NotifyIcon.Shared/TaskbarIcon.cs:line 128
at H.NotifyIcon.TaskbarIcon.<.ctor>b__11_0(Object _, EventArgs _) in /Users/dtoth/Downloads/H.NotifyIcon-master/src/libs/H.NotifyIcon.Shared/TaskbarIcon.cs:line 60

MacOS

Version 15.4.1 (24E263)

dotnet --info:

.NET SDK:
Version: 9.0.202
Commit: 3a53853c30
Workload version: 9.0.200-manifests.5c4e24dc
MSBuild version: 17.13.13+1c2026462

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.4
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.202/

.NET workloads installed:
[maui]
Installation Source: SDK 9.0.200
Manifest Version: 9.0.14/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.14/WorkloadManifest.json
Install Type: FileBased

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.3
Architecture: arm64
Commit: 831d23e561

.NET SDKs installed:
8.0.402 [/usr/local/share/dotnet/sdk]
9.0.202 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
/Users/dtoth/Downloads/H.NotifyIcon-master/global.json

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Steps to reproduce the bug

  1. Download the sample app
  2. Try to run MAUI one on Mac

Expected behavior

The sample app runs and the notifyicon is shown properly

Screenshots

Image

NuGet package version

No response

Platform

No response

IDE

Other

Windows Version

No response

WindowsAppSDK Version

No response

WindowsAppSDK Type

None

Manifest

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions