I have two solutions that use the same project. One has the choice to use .net 8 and the other list nothing higher than .net 6

David Van Diest 0 Reputation points
2023-12-13T16:13:25.5566667+00:00

I have updated to the most current version of visual studio as of 12.12.23.

I have two different solutions using the same project and lets call it X. In solution 1 I can set project X to use .NET 8. In solution 2 for project X the highest .NET that shows up is .NET 6.

What do I have to change so I can list .NET 8 from both solutions since X is a shared project.

Thanks

-Dave

Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

2 answers

Sort by: Most helpful
  1. David Van Diest 0 Reputation points
    2023-12-14T14:12:21.82+00:00

    Version:

    User's image

    Both of the solutions started out using projects with .NET 6. After Upgrading visual studio I was working on the one that happens to show me .NET 8 in the properties of the project and saved it. No problems. I then was in the other solution and looked at the properties by choosing properties of the project Target Framework dropdown is empty

    User's image

    The drop down in this solution maxes out with .net 6

    User's image

    The project file has the correct .NET version

    <TargetFramework>net8.0</TargetFramework>

    its just thta when viewing the properties that .net 8 does not show up

    The solution that does not show .net 8 in properties has the class libraries and function apps and test projects

    The solution that lets has visual studio displaying .NET 8 as an option has the shared class lib and a mvc website project.

    0 comments No comments

  2. Tianyu Sun-MSFT 34,686 Reputation points Microsoft External Staff
    2023-12-15T03:33:09.86+00:00

    Hi @David Van Diest ,

    Looks like .NET 8.0 has been installed on your machine and it can be detected and used by VS. There must be something set differently in these two solutions. In one solution, no block, but in the other it prevents VS use and set target framework .NET 8.0 for the project.

    Are you using a global.json file, maybe in one of the solution directories/folders? If so, was it set to limit the version of .NET?

    Kind Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.