CsWin32: Can't work in WinUI 3 project
Start from WinUI 3 Preview 3 template project
Add package reference to Microsoft.Windows.CsWin32
, with GetActiveWindow
in NativeMethods.txt
Make a call to the method anywhere.
The IDE can correctly analysis all the occurrence and references of the method. However, when building the project, the command line output shows error CS0234: No member ‘Windows’ in namespace ‘Microsoft’.
I think this is https://github.com/dotnet/roslyn/issues/46420 , in another way.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (4 by maintainers)
Commits related to this issue
- Add `global::` in front of all `using` directives This addresses one problem with WinUI 3 projects consuming the generated source, as tracked by #59. — committed to microsoft/CsWin32 by AArnott 3 years ago
- Prefix Guid with `global::` Fixes #124 Fixes #59 — committed to microsoft/CsWin32 by AArnott 3 years ago
- Prefix Guid with `global::` Fixes #124 Fixes #59 — committed to microsoft/CsWin32 by AArnott 3 years ago
Seems duplicate to this: https://github.com/dotnet/roslyn/issues/46300
Just confirming that 0.1.370-beta works great with WinUI 3. Thank you!