-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Please also add .net as TargetFramework (makes it possible to unit test my maui project) #102
Comments
There is no implementation for net7.0 though - are you using ui in your unit tests? |
An implementation for net7.0 is not needed imho. So to resume: you won't need to change anything beside adjusting the csproj file. No concrete implementation is needed. |
That's not quite true. There needs to be code to handle and provide developers with feedback that platforms aren't supported like if they try and run it on tizen or macos. |
UnitTest won't work in a android project (they don't run).
I don't think that's needed, since you don't target them by adding |
They will work in a Windows project or use a test runner to run on actual devices . |
I use xunit to run my unit-tests, why would I want to run those on a device? The only thing that's blocking me, is that this package also needs to target the "standard framework". When you look at for example: https://github.com/Alex-Dobrynin/Controls.UserDialogs.Maui/tree/master this doesn't need any specific implementation when using the default framework (= net8.0 for this example). So I'm pretty sure, that besides adding it in the csproj file, no changes are required.
I don't understand what you're saying here, to be honest. Can you elaborate please? |
If you use my library in a Tizen app it will use the net7.0 library since there isn't a platform match and it won't work. I'm not saying it isn't possible, but it isn't true that there are no code changes needed. At a minimum there needs to be platform support attributes, so the tizen developer at least gets build warnings. RIght now I'm avoiding all that by clearly stating which platforms I support. |
Why wouldn't you? Your users will be running on a device. You'd be surprised about the number of platform differences. I daily run all my unit tests on windows, ios, catalyst and android devices. |
That's correct indeed. Indeed splitting them would also solve this. But any guide/faq/example for Maui I have seen so far, is build that way. Don't get me wrong, I truly have respect for the work you are doing and the package itself, but this is really blocking me.
I don't think that's true; cause that's kind of like the issue I'm currently facing: a (test) project in "standard .net 7.0" which can't build cause of a linked package doesn't target it. Maybe, in worst case, you can do something like: |
Again I'm not saying I won't address this - just that it's a little bit more work than you think if you want to do it right and I'm pretty backed up with work for the next month or so. It is open source so you can use a custom local build until I get to it.
|
I'm very happy with your lib @dotMorten, but I'm facing the same issue as @3sRykaert. I have non-platform specific unit-test on services and view-models. For this reason, I target my own app for .net-8.0. I might be able to make my client support you, @dotMorten what would I take to make you prioritize adding .net support? |
Can you help me understand how you’re using this control in your services and view models? That sounds counter to the mvvm patterns |
Hi @dotMorten thx for your reply. I'm using your lib on a single page in a xaml-file and a code-behind file (not really mvvm in this case), but no where else. I do not make any test of this specific page. In fact I only make test of services and view-models, I do not make ui-test. The thing is, that the code is not specific to either android nor ios (my two target platforms for the users), so targeting .net for test seems like the right choice. Back in the Xamarin.Forms days, I had a shared .net project, that android and ios just depended on. And a unit test-suite for the shared .net project (no test for the android and ios projects). |
In the following file:
https://github.com/dotMorten/MauiEx/blob/main/MauiEx/MauiEx.csproj
Please change:
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
To:
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
That way a unittest project can also run against a maui project that uses this package.
The text was updated successfully, but these errors were encountered: