Version not match

BenTam 1,621 Reputation points
2022-11-11T09:54:25.34+00:00

Dear All,

I encounter an error as follows. Could anyone suggest a solution?

The primary reference "C:\Users\Ben Tam\source\repos\NewTims\Library\bin\Debug\Library.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "C:\Users\Ben Tam\source\repos\NewTims\Library\bin\Debug\Library.dll" or retarget your application to a framework version which contains "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. BenTam 1,621 Reputation points
    2022-11-12T02:25:34.433+00:00

    I find the answer as follows.

    1. Open the project file ObjectListView.csproj.
    2. Locate the line <TargetFrameworkVersion>2</TargetFrameworkVersion>
    3. Change 2 to 4.8

    That will fix the error.