Skip to content
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

Project is not compatible with net8.0 (.NETCoreApp,Version=v8.0) #17791

Closed
Jocrod1 opened this issue Oct 3, 2023 · 4 comments
Closed

Project is not compatible with net8.0 (.NETCoreApp,Version=v8.0) #17791

Jocrod1 opened this issue Oct 3, 2023 · 4 comments
Labels
potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/not-a-bug This isn't actually a bug, or is working as expected t/bug Something isn't working

Comments

@Jocrod1
Copy link

Jocrod1 commented Oct 3, 2023

Description

Can't do Unit Tests because it says the xUnit Project is not compatible

Steps to Reproduce

try to run tests

Link to public reproduction project repository

https://github.com/Jocrod1/MauiProjWTests

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.92

Affected platforms

I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@Jocrod1 Jocrod1 added the t/bug Something isn't working label Oct 3, 2023
@drasticactions
Copy link
Contributor

Your repository link 404s, I think it's private?

@drasticactions drasticactions added the s/needs-repro Attach a solution or code which reproduces the issue label Oct 3, 2023
@ghost
Copy link

ghost commented Oct 3, 2023

Hi @Jocrod1. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Jocrod1
Copy link
Author

Jocrod1 commented Oct 3, 2023

i accidentally uploaded the repo in private. It's now public.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Oct 3, 2023
@drasticactions
Copy link
Contributor

Thank you!

I believe the error is correct:

https://github.com/Jocrod1/MauiProjWTests/blob/master/TestsProj/TestsProj.csproj#L4

https://github.com/Jocrod1/MauiProjWTests/blob/master/MauiProjWTests/MauiProjWTests.csproj#L4

The XUnit project is net8.0. MAUI UI Single Project files reference individual platforms (net8.0-android, etc). You're trying to reference that project inside a non platform specific project, which won't work. It's not a MAUI issue, it's how Target Frameworks operate. You would hit similar issues if you were trying to reference net8.0-android class libraries inside a net8.0 XUnit project.

If you're trying to do UnitTests on non-UI parts of your code, I believe the best thing to do would be move them into another class library that's not platform specific (net8.0, net7.0, netstandard2.0 etc) and reference that instead. Otherwise, you would need to set up a device test runner and run them on the actual platform.

CC @BretJohnson @PureWeen is there anything else they could do? I know there's a bunch happening right now in the repo with XUnit and device testing.

@samhouts samhouts added the s/not-a-bug This isn't actually a bug, or is working as expected label Oct 3, 2023
@Jocrod1 Jocrod1 closed this as completed Oct 4, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2023
@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/not-a-bug This isn't actually a bug, or is working as expected t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants