microsoft / microsoft/CsWin32

CS1591 Warning occurring when making generated types `public`

Open
#1,609 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
2.5k
Forks
123
Avg merge
1d 3h
Merged PRs (30d)
9

Description

Actual behavior

When setting "public": true in the NativeMethods.json file the compiler outputs warnings for missing XML Comments after building the application.

Types I am aware of right now (in my project):
ITaskbarList2.HrInit()
ITaskbarList2.AddTab(HWND)
ITaskbarList2.DeleteTab(HWND)
ITaskbarList2.ActivateTab(HWND)
ITaskbarList2.SetActiveAlt(HWND)
ITaskbarList3.HrInit()
ITaskbarList3.AddTab(HWND)
ITaskbarList3.DeleteTab(HWND)
ITaskbarList3.ActivateTab(HWND)
ITaskbarList3.SetActiveAlt(HWND)
ITaskbarList3.MarkFullscreenWindow(HWND, BOOL)

Expected behavior

No warnings and docs are generated accordingly.

Repro steps

  1. NativeMethods.txt content:
// Debug purpose only
AllocConsole

// Taskbar progress bar
ITaskbarList3
TaskbarList
TBPFLAG

// Hide window from screenshot tools
SetWindowDisplayAffinity

// Clipboard operations
OpenClipboard
EmptyClipboard
GlobalAlloc
GLOBAL_ALLOC_FLAGS
CLIPBOARD_FORMAT
GlobalLock
GlobalFree
GlobalUnlock
SetClipboardData
CloseClipboard
  1. NativeMethods.json content (if present):
{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "comInterop": {
    "useComSourceGenerators": true
  },
  "public": true
}
Context
  • CsWin32 version: 0.3.265
  • Win32Metadata version: 68.0.4-preview & 0.13.25-experimental
  • Target Framework: net10.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NativeMethods.json setting that makes generated types public and reproduce the CS1591 warnings using the NativeMethods.txt entries. Trace how the source generator emits the listed COM members, then verify that the build has no missing-XML-comment warnings and documentation is generated for the public types.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.