.net framework style project support broken?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 124
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Description
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.txtcontent:
SetProcessWorkingSetSize (can be anything)
NativeMethods.jsoncontent (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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the attached WpfApp1.zip repro in Visual Studio 2022 and inspect the generated P/Invoke output and CS0246 build error for the .NET Framework 4.8 project. Start with the NativeMethods.txt input and compare behavior against a supported project type. Done means the generated functions remain available and the WPF project compiles successfully.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100