Enhancer ignores assembly redirects and EnhancerDoNotCheckVersionOfReferencedAssemblies

Thread is closed for posting
3 posts, 1 answers
  1. Bernd
    Bernd avatar
    91 posts
    Member since:
    Feb 2013

    Posted 28 Mar Link to this post

    Hi.

    I have a project where a library references an older version of another library.

    Having a redirect in app.config and

    <EnhancerDoNotCheckVersionOfReferencedAssemblies Condition="'$(EnhancerDoNotCheckVersionOfReferencedAssemblies)'==''">false</EnhancerDoNotCheckVersionOfReferencedAssemblies>

    in my OpenAccessNuGet.targets file is of no use.

    I always get this build error:

    System.IO.FileLoadException: Die Datei oder Assembly "idee5.Common, Version=3.0.5.241, Culture=neutral, PublicKeyToken=69ecdbed3e0936e3" oder eine Abhängigkeit davon wurde nicht gefunden. Allgemeine Ausnahme (Ausnahme von HRESULT: 0x80131500)
    Dateiname: "idee5.Common, Version=3.0.5.241, Culture=neutral, PublicKeyToken=69ecdbed3e0936e3" ---> System.Exception: The referenced assembly 'E:\NuGetPackages\idee5.Common.3.0.6\lib\netstandard2.0\idee5.Common.dll' has the wrong version; expected Version=3.0.5.241 but found Version=3.0.6.3.
       bei Telerik.OpenAccess.SPI.AssemblyProvider.LoadFromReferences(String assemblyName)
       bei Telerik.OpenAccess.SPI.AssemblyProvider.RefResolveEventHandler(Object sender, ResolveEventArgs args)
    ...

    I am using the last available version 2016.2.822.1.

    How can I fix this?

    Kind regards

    Bernd

  2. Answer
    Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    323 posts

    Posted 28 Mar Link to this post

    Hello Bernd,

    I believe you have to set EnhancerDoNotCheckVersionOfReferencedAssemblies = true to enable the desired behavior.
    Also redirects applies in app.config/web.config apply to the application that you are developing not to Enhancer.exe.
    If you have trouble using the build argument you may want to try editing Enhancer.exe.config (found under $(SolutionDir)\packages\Telerik.DataAccess.Fluent.*\tools\enhancer\) and apply the redirects there. This is not the recommended approach as the config file may get overwritten when you restore nuget packages.

    Regards,
    Viktor Zhivkov
    Progress Telerik
    Telerik Data Access is no longer being developed. For more information please refer to this page.
  3. Bernd
    Bernd avatar
    91 posts
    Member since:
    Feb 2013

    Posted 28 Mar in reply to Viktor Zhivkov Link to this post

    Hi Viktor.

    Thank you for the fast answer. Works like a charm.

    And I am still sorry about DataAccess being deprecated. A great tool and EF is IMHO no match for it.

    Regards
    Bernd

Back to Top