Skip to content

PInvoke is inaccessible due to its protection level #1429

@sakgoyal

Description

@sakgoyal

Actual behavior

Similar to #936
I am unable to get this working and I get this error:

Image

seems like I have a dependency that also uses this and explicitly sets public to false. Is there away around this?
I have WinUIEx as a dependency
https://github.com/dotMorten/WinUIEx/blob/main/src/WinUIEx/NativeMethods.json

Expected behavior

The error should not happen just because another dep has set public to false. (at least thats my understanding of why the error is happening)

Repro steps

  1. NativeMethods.txt content:
Shell_NotifyIconGetRect
Shell_NotifyIcon
  1. NativeMethods.json content (if present):
{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "public": true
}
  1. Any of your own code that should be shared?

Image

Context

  • Target Framework: net9.0-windows10.0.19041.0
  • LangVersion: preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions