dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.91k stars 1.69k forks source link

Nunits/Xunits support only .net8.0 and cannot be written specifically for either .net8.0 android or ios #23568

Closed SurajImmanuel closed 2 weeks ago

SurajImmanuel commented 3 weeks ago

Description

Some of the external libraries released for MAUI does not support generic .net8.0 and are targeted towards android or IOS . N-units or X-units require .net8.0 to be added as a target framework which is not supported by these libraries. Although for .cs files, you have a way to make it compile still ,by having multi target platform codes . XAML does not have any option when a class from that library is used inside it .

Steps to Reproduce

  1. Create a new MAUI project
  2. Download Scandit MAUI as nuget package
  3. Include Scandit library as namespace in xaml and use its datacapture view
  4. Now create a new Xunit/Nunit project and add this MAUI as project reference
  5. You will notice that XAML file is not recognized by this .net8.0 framework.

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

IOS11,Android13,Xunit

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 3 weeks ago

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 and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

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

PureWeen commented 2 weeks ago

@SurajImmanuel you'll need to open issues on the repositories to provide those targets.

My guess is that those libraries don't really have any useful code they can run inside a net8.0 target, so, if you want to include them inside some tests you'll want to follow the guidelines for appium https://learn.microsoft.com/en-us/samples/dotnet/maui-samples/uitest-appium-nunit/

SurajImmanuel commented 2 weeks ago

@PureWeen My issue is Nunit demands us to include .net8.0 as target framework which is not our project demands and the libraries that we use do not support .Net8.0 and are more platform specific ( either android or IOS ) , I really cannot do much if .net8.0 does not support the namespace included in XAML .