user11631417
user11631417

Reputation:

Referencing .net Standard assembly from .NET Core project causes reference error

I am trying to reference a compiled .NET Standard 2.0 assembly from a .NET Core 2.1 project. Both are using the Microsoft extensions logging abstractions library. When I try to compile I get the following error:

Error CS1705 Assembly 'X' with identity 'X, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Logging.Abstractions' with identity 'Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

I tried updating the .net core Microsoft extensions logging reference to the latest version but the numbers in the build error do not change. What am I missing here?

Upvotes: 1

Views: 523

Answers (1)

user11631417
user11631417

Reputation:

As Chathurangas comment pointed out the solution was to first package the .net standard library as a nuget package using "dotnet pack" then reference the package from my .net core project.

Upvotes: 0

Related Questions