I am migrating application from dot net 4.8 to dot net core 8. facing error Project ..\folder\folder.csproj targets net8.0. It cannot be referenced by a project that targets .NETFramework,Version=v4.8.

Sayali Mahale 20 Reputation points
2025-01-03T11:53:02.5433333+00:00

I am migrating application from dot net 4.8 to dot net core 8.

facing error Project ..\folder\folder.csproj targets net8.0. It cannot be referenced by a project that targets .NETFramework,Version=v4.8.

Project ..\folder1\folder1.csproj targets net8.0. It cannot be referenced by a project that targets .NETFramework,Version=v4.8.

Project ..\folder2\folder2.csproj targets net8.0. It cannot be referenced by a project that targets .NETFramework,Version=v4.8.

all errors are in Folder3 project, which depends on folder, folder1 and folder2.

folder, folder1 and folder2 are migrated in dot net core.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,035 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,731 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,561 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,186 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
362 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 69,121 Reputation points
    2025-01-03T17:23:59.3966667+00:00

    .net 4.8 projects cannot reference .net core libraries, nor can .net core call 4.8 project libraries. This means to migrate to .net 8 you need to update every project in the solution to .net 8.

    an alternative is is to update all libraries to .net standard 2.0. These are callable from both .net 4.8 and .net 8. This can be done a project at a time. When all libraries have been migrated, the the main project(s) can be migrated to .net 8


0 additional answers

Sort by: Most helpful

Your answer

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