Forum Discussion
Assembly References Getting Added to Every Platform in .NET MAUI
In the MAUI application, If you add an assembly reference to one Platform, it gets added to every Platform.
Steps to Reproduce:
1. Create a new .NET MAUI App
2. Under same solution created an Android Class Library project(<TargetFramework>net7.0-android</TargetFramework>)
3. Right-click on Maui main project Dependencies
4. Add a new project reference (a local DLL, not a NuGet package)
5. Observe the reference was also added to every Platform dependencies (Android, iOS, maccatalyst)
Even if i add Condition like : Condition="'$(TargetFramework)' == 'net7.0-android'"or Condition="$(TargetFramework.Contains('-android')) != false ", It did not work.
I am in the lasted Visual Studio for MAC.
2 Replies
- LanHuangFormer Employee
Hi dewank2,
Thanks for posting your issue here.
However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang