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.
NativeMethods.txt content:
SetProcessWorkingSetSize (can be anything)
NativeMethods.json content (if present):
- 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
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:
Expected behavior
Project should compile successfully.
Repro steps
Just create a WPF (.net framework) project In latest VS2022 and add some PInvoke functions.
NativeMethods.txtcontent:NativeMethods.jsoncontent (if present):WpfApp1.zip
Context
LangVersion(if explicitly set by project): latest