microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Only two project references can be added to a winui3 desktop application

Open markmower opened this issue 1 year ago • 2 comments

Describe the bug

When creating a new WinUI3 Desktop application and using it in unpackaged mode I want to sperate out all my UI, so I create several WinUI3Class libraries.

It appears after creating the initial Winui3 Desktop application and then adding WinUI3 Class libraries I can create one core application and three Class libraries.

In Visual studio 2022 17.10.2 When adding project references to the first two class libraires everything is working fine, however when I add a third class library its appear in the project dependencies but does not have the expanding arrow like the first two.

And If I write code in the app,xaml.cs and get assemblies and then write out assembly names using system.diagnostics.debug the third assembly is not in the list. and hence any code I am trying to use is not working.

Is there a limit on the Project References as two work fine and anymore does not?

Steps to reproduce the bug

Create and new Windows WinUI3 Desktop Application Set the Project file to run unpackaged Create three WinUI3 Class Libraries Add project references for the three libraries in the main project In app.xaml.cs in the onlaunched event get a list of all the assemblies and write out using diagnostics debug the fullname of the assemblies.

Anything more than the first two project references and not added to the assemblies list.

Also ion the main WinUI3 Application and you expand the dependencies and project references you will always se the first two with arrow to expand anymore 3 onwards does not have that.

Expected behavior

Should be able to add more than two Project references to a WINUI3 application

Screenshots

image

NuGet package version

None

Windows version

Windows 10 (21H1): Build 19043

Additional context

Is there a limit on project references for an unpackaged WinUI3 Application?

markmower avatar Jun 14 '24 16:06 markmower

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jun 14 '24 16:06 github-actions[bot]

Sounds like a VS issue?

codendone avatar Jun 20 '24 16:06 codendone

@markmower Thanks for reporting this issue. Unfortunately, I'm unable to reproduce it from the instructions provided. I noted that the expand arrow next to each project reference appears to be "lazily" generated. Not until I close and reopen the solution do I see the nested transitive dependencies for a newly added class library. Another thing I noticed is that unless I consume code from a class library, its assembly is not loaded and it is not reported in the OnLaunched event handler. Aside from that, I was able to add 4 class libraries without issue and see their dependencies listed under project references, and their assemblies loaded, provided I consumed them.

Scottj1s avatar Jul 05 '24 23:07 Scottj1s

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.