Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not Load Type from Microsoft.Extensions.Logging.Abstractions

I have a solution that works on some computers and not others. The exception is this:

Could not load type 'Microsoft.Extensions.Logging.Abstractions.Internal.NullScope' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60

Added information from Diagnostic set Output Build says:

Exception Thrown: 'System.Exception' in Services.dll. Exception Thrown: 'System.Exception' in System.Private.Corelib.dll

I'm trying to figure out the difference between the two computers and coming up short.

  • Both computer that works/doesn't work are running VS2017 v15.9.17.
  • Both computers have .NET Framework 4.0 installed
  • Startup project uses C# 7.1
  • Startup project is .NET Core 2.0
  • Project that output says is throwing the error is .NET Standard 2.0
  • The startup project is using dependency injection to create services that access a DB via DBContexts
  • The call that is failing is:
CustomUnit unit = await _dbContext.CustomUnit
                    .Include(x => x.Type)
                    .Include(x => x.UnitBuckets)
                    .Include(x => x.InventoryBuckets)
                    .Include(x => x.WIPBuckets)
                        .ThenInclude(y => y.Unit)
                    .SingleOrDefaultAsync(x => x.UnitId == unitId);

The machines that work always work and the machines that don't never work. I've tried clearing the nuget cache, deleting and re-adding references, deleting and re-cloning project to new location all to no result. Since all machines have freshly pulled the code from the same branch with no modifcation, the code base is identical. I've been unable to find any differences between the two machines that would explain why it works on one and not the other. Anyone have any ideas?

like image 284
LizP Avatar asked Nov 29 '22 05:11

LizP


1 Answers

I solved it installing 'Microsoft.Extensions.Logging' from Nuget

like image 161
Bruno M. Avatar answered Nov 30 '22 18:11

Bruno M.