Skip to content

.net framework style project support broken? #1625

@theoractice

Description

@theoractice

Actual behavior

In .net framework style project, PInvoke functions are generated correctly, however the project cannot compile. I have uploaded a repro below.
Error info:

error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?)

Expected behavior

Project should compile successfully.

Repro steps

Just create a WPF (.net framework) project In latest VS2022 and add some PInvoke functions.

  1. NativeMethods.txt content:
SetProcessWorkingSetSize (can be anything)
  1. NativeMethods.json content (if present):
  1. Any of your own code that should be shared?
    WpfApp1.zip

Context

  • CsWin32 version: v0.3.269
  • Win32Metadata version (if explicitly set by project): not set
  • Target Framework: .net framework 4.8
  • LangVersion (if explicitly set by project): latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions