1

We have some files from ASP.NET Core 3.1 that work in a server with no errors but in another server in one of its services we encounter this error (with the exactly same file).I am going to put the whole error that I am encountering bellow:

Error Source: KellermanSoftware.Compare-Net-Objects
Error Target Site: Boolean IsFont(System.Type)
Error Message: Could not load file or assembly 'System.Drawing.Common, Version=4.0.2.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Error StackTrace:    at KellermanSoftware.CompareNetObjects.TypeHelper.IsFont(Type type)
   at KellermanSoftware.CompareNetObjects.TypeComparers.FontComparer.IsTypeMatch(Type type1, Type type2)
   at KellermanSoftware.CompareNetObjects.RootComparer.<>c_DisplayClass3.<Compare>b_1(BaseTypeComparer o)
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at KellermanSoftware.CompareNetObjects.RootComparer.Compare(CompareParms parms)
   at KellermanSoftware.CompareNetObjects.CompareLogic.Compare(Object object1, Object object2)
   at Services.Security.Auditing.AuditLogService.CreateAuditLogBatch(Guid userId, AuditActionType action, List`1 keyFieldIds, List`1 oldObjects, List`1 newObjects) in D:\FON2019\Version\Security\Services.Security\Auditing\AuditLogService.cs:line 65

Thank for you time.

phuzi
  • 12,078
  • 3
  • 26
  • 50
hamid
  • 31
  • 2
  • As far as I'm aware `System.Drawing.Common` is only available on Windows. Wht OS is the "other server" running? – phuzi Aug 31 '22 at 11:54
  • May be related: https://stackoverflow.com/questions/40892189/net-core-and-system-drawing – phuzi Aug 31 '22 at 11:55
  • 1
    Maybe you can try to use System.Drawing.Common 6.0.0. – Yiyi You Sep 01 '22 at 07:17
  • Thanks @YiyiYou you saved my time as I was having same issue and successfully resolved my error by installing System.Drawing.Common 6.0.0 also make sure that to set the target framework to '.NET Core 3.1'. or later in project properties :) – Ahmad Jul 07 '23 at 14:10

1 Answers1

0

I was having same issue and successfully resolved my error by installing System.Drawing.Common 6.0.0 also make sure that to set the target framework to '.NET Core 3.1'. or later in project properties :)

Ahmad
  • 1,462
  • 5
  • 17
  • 40