Giter Club home page Giter Club logo

Comments (17)

dotMorten avatar dotMorten commented on July 19, 2024 2

Seems duplicate to this: dotnet/roslyn#46300

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024 1

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

from cswin32.

AArnott avatar AArnott commented on July 19, 2024

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.

from cswin32.

huoyaoyuan avatar huoyaoyuan commented on July 19, 2024

No, the workaround for #7 doesn't work here.

Seems that WinUI invokes legacy roslyn somehow.

from cswin32.

AArnott avatar AArnott commented on July 19, 2024

@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?

from cswin32.

huoyaoyuan avatar huoyaoyuan commented on July 19, 2024

@AArnott

https://github.com/microsoft/microsoft-ui-xaml
https://aka.ms/winui3/preview3-download

I can open issue myself there. They have been incompatible with several compiling stuff like dotnet build, <Nullable>enable</Nullable>.

If you have internal contacts, you may ask them about their interaction with roslyn and msbuild team. Thanks.

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

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.
Are you targeting Win32 or UWP?

from cswin32.

huoyaoyuan avatar huoyaoyuan commented on July 19, 2024

I'm targeting Win32.

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

OK this is odd. Just created a new project and hit the same thing while compiling:

image

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

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.

from cswin32.

huoyaoyuan avatar huoyaoyuan commented on July 19, 2024

Yes. The #nullable issue occurs too when I add XAML. So I suspect they have the same root cause.

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

Seems like the XamlPrecompile step isn't including the generated files, and thus fails:
image

from cswin32.

huoyaoyuan avatar huoyaoyuan commented on July 19, 2024

OK. So if XamlPrecompile invokes csc with custom command line and may not respect csproj, it's reasonable to report warning for no <Nullable>enable</Nullable>.

from cswin32.

Sergio0694 avatar Sergio0694 commented on July 19, 2024

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 🤔

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

@Sergio0694 Yes agreed. Not specific to this. It should probably be moved to the WinUI repo

from cswin32.

AArnott avatar AArnott commented on July 19, 2024

Some investigations led to dotnet/msbuild#6096, which may fix the WinUI problem.

from cswin32.

dotMorten avatar dotMorten commented on July 19, 2024

@AArnott That helps some.
As mentioned in email "offline", the code generator need to prefix usings with global:: or it'll clash with WinUI. (props to @chsienki for discovering this)

from cswin32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.