English 中文(简体)
MAUI Project is not compatible with net7.0 when I try to build it on windows but it builds on mac
原标题:

I have a solution with 2 projects and a unit test project in it. When I try to build it in my windows machine, I get the following error message

Error NU1201: Project SampleProject is not compatible with net7.0 (.NETCoreApp,Version=v7.0). Project SampleProject does not support any target frameworks. This error is from the test project - SampleProject.Tests

What is the cause of this issue? If I remove .net7-0 from the targetframework of my projects, the app builds without building test project. How do I fix this?

问题回答

To fix this issue, you will need to select a compatible target framework for the "SampleProject" project to use. If you want this project to run with the test project, you will also need to set the target framework for the "SampleProject.Tests" project to the same framework. You can do this by opening the project properties and changing the target framework in the "Application" tab of the project settings. If you are using Visual Studio, you can right-click on the project -> Properties -> Application -> Target framework dropdown. If you are using .NET CLI, you can update the target framework in the project file (e.g., SampleProject.csproj).





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签