0

I have a C# project that uses a third-party library which depends on old version DevExpress. There is a bug in a dll(DevExpress.Utils.v9.2.dll) of this version DevExpress. I use .NET Reflector and Reflexil to patch the dll and use the patched dll replace the old one. Then when I rebuild solution, Visual Studio shows me error:

Error CS0012 The type 'XtraForm' is defined in an assembly that is not referenced. You must add a reference to assembly 'DevExpress.Utils.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a'.

It seems original dll is signed that causes the problem. I have tried removing strong name but it does not work. How to resolve?

AlpacaMan
  • 465
  • 2
  • 7
  • 24
  • Can you derive a class from original XtraForm, fix the bug there, and reference new dll (which references Devexpress' dll) – Marko Juvančič Aug 07 '19 at 10:02
  • If you had a valid license at the time the DevExpress XtraEditors v9.2 assembly was produced you will still have access to download it. There is likely a minor version upgrade to which you would still have access that may have a fix to the bug you are encountering. Trying to rebuild the signed assemblies after decompililng them may be a violation of the DevExpress end-user license agreement (EULA) as well: https://www.devexpress.com/Support/EULAs/winforms-controls.xml – Brendon Aug 07 '19 at 20:52
  • @Brendon, According to this [post](https://www.devexpress.com/Support/Center/Question/Details/B192449/system-overflowexception-in-appearancehelper-gethashcodecore-on-64-bit-system), the bug is fixed in version 10.1.8. – AlpacaMan Aug 08 '19 at 00:01
  • Frankly I think your only option would be to upgrade to that version. If you had a license for v9.2 that included source code, you could modify that yourself and provide it to DevExpress, who will digitally sign it for you. I don't believe they will do that with a decompiled source however. – Brendon Aug 09 '19 at 13:51

2 Answers2

1

Use the awesome alternative to ILSpy and friends: dnSpy.

dnSpy

Waescher
  • 5,361
  • 3
  • 34
  • 51
0

The problem is that other assemblies reference the signed DevExpress.Utils.v9.2.dll. After patching, the dll is unsinged so it does not work. I solve the problem myself by adding referencing assemblies to update and removing strong name and updating referencing assemblies using Strong Name Remover bundled with Reflexil.

enter image description here

AlpacaMan
  • 465
  • 2
  • 7
  • 24