Closed hpathanjaly closed 2 months ago
I have same issue. My test project targets net8.0 in this way:
<TargetFramework>net8.0</TargetFramework>
and have a reference for my maui project, which also tatgets net8.0, it looks like this:
<TargetFrameworks>net8.0-android</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net8.0</TargetFrameworks>
You can have a look on how maui community toolkit makes taragetting: https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui/CommunityToolkit.Maui.csproj
You will see that they have $(NetVersion) which will be transformed to net8.0 in our case:
<TargetFrameworks>$(NetVersion);$(NetVersion)-android;$(NetVersion)-ios;$(NetVersion)-maccatalyst</TargetFrameworks>
So basically, you need to change csproj to make TargetFrameworks look like this:
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
And fix related issues that might appear
@hpathanjaly @nikitaKlymchukGunnebo Please check version 1.0.5
1.0.5 fixed this issue
Updated and still showing this wherever I use the package. Am i doing something wrong?
Just fully uninstalling and reinstalling the package seems to have worked. Ill close the issue after a little more testing. Thank you for the quick responses!
I'm pretty new to MAUI so I might have missed something here but since the PdfView is not compatible with net8.0 on its own and xUnit's target framework is net8.0, adding my project as a dependency to the test project led to a bunch of errors wherever the pdf view was mentioned. I had to add preprocessor directives to check whether the program was running on windows, mac, ios, or android and then include the pdf view. this also forced me to add the pdf view element from the code behind. Was there a better way to do this or did i miss something? I have attached images of my workaround