-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't work in WinUI 3 project #59
Comments
I am not familiar with WinUI 3. But the symptoms are very similar to #7. Can you try the workaround documented there to see if it helps? Otherwise, we may need to move your bug to the WinUI team. |
No, the workaround for #7 doesn't work here. Seems that WinUI invokes legacy roslyn somehow. |
@huoyaoyuan Where can I get this WinUI project template you're talking about so I can test it? Any idea where we can file issues against it? |
https://github.com/microsoft/microsoft-ui-xaml I can open issue myself there. They have been incompatible with several compiling stuff like If you have internal contacts, you may ask them about their interaction with roslyn and msbuild team. Thanks. |
I'm successfully using this with WinUI3. I've used this to have my WinUI3 app generate a tray icon, and clicking the tray icon will bring the WinUI3 window to the top. |
I'm targeting Win32. |
Investigating some more: The reason it worked for me was I was building a class library. But the moment I add XAML to that class library, this error occurs. |
Yes. The |
OK. So if |
Seems duplicate to this: dotnet/roslyn#46300 |
Not sure if this has already been mentioned, but it seems this is not specific to WinUI 3 - I get the same exact error when trying to use a source generator that interacts with a XAML-related file in any way on vanilla UWP (SDK 19041) as well 🤔 |
@Sergio0694 Yes agreed. Not specific to this. It should probably be moved to the WinUI repo |
Some investigations led to dotnet/msbuild#6096, which may fix the WinUI problem. |
This addresses one problem with WinUI 3 projects consuming the generated source, as tracked by #59.
Just confirming that 0.1.370-beta works great with WinUI 3. Thank you! |
Start from WinUI 3 Preview 3 template project
Add package reference to
Microsoft.Windows.CsWin32
, withGetActiveWindow
in NativeMethods.txtMake 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 dotnet/roslyn#46420 , in another way.
The text was updated successfully, but these errors were encountered: