- 
                Notifications
    You must be signed in to change notification settings 
- Fork 114
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Actual behavior
Building the project fails to generate the sources when a NativeMethods.json file exists.
The following warning is emitted:
CSC : warning CS8785: Generator 'SourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'System.Text.Encodings.Web, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'
Expected behavior
The sources are successfully generated during the build.
Repro steps
- NativeMethods.txtcontent:
CopyFileEx
CoTaskMemFree
ExtractIconEx
FileOpenDialog
FileSaveDialog
GetActiveWindow
GetModuleFileName
GetSystemWindowsDirectory
GetWindowLongPtr
HRESULT_FROM_WIN32
IFileDialog
IShellItem2
ITaskbarList3
SendMessage
SetWindowLongPtr
SHCreateItemFromParsingName
ShellExecuteEx
SHGetFileInfo
SHGetKnownFolderItem
SHGetStockIconInfo
SHOpenFolderAndSelectItems
SHParseDisplayName
StrCmpLogical
TaskbarList
TaskDialogIndirect
E_*
FOLDERID_*
ICON_*
MAX_PATH
MESSAGEBOX_RESULT
PBST_*
S_*
SEE_MASK_*
SHOW_WINDOW_CMD
TASKDIALOG_ELEMENTS
TASKDIALOG_MESSAGES
TD_*
WIN32_ERROR
WINDOW_EX_STYLE
WM_*
- NativeMethods.jsoncontent (if present):
{
  "$schema": "https://aka.ms/CsWin32.schema.json",
  "comInterop": {
    "preserveSigMethods": [
      "IFileDialogEvents"
    ]
  }
}- Any of your own code that should be shared?
Context
- CsWin32 version: 0.3.49-beta
- Win32Metadata version (if explicitly set by project): 59.0.13-preview
- Target Framework: net5.0-windows
- LangVersion(if explicitly set by project): -
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working