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

Most upvoted comments

Just confirming that 0.1.370-beta works great with WinUI 3. Thank you!