This is a migrated thread and some comments may be shown as answers.

Enhancer ignores assembly redirects and EnhancerDoNotCheckVersionOfReferencedAssemblies

2 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bernd
Top achievements
Rank 2
Bernd asked on 28 Mar 2018, 01:18 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Zhivkov
Telerik team
answered on 28 Mar 2018, 02:10 PM
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.
0
Bernd
Top achievements
Rank 2
answered on 28 Mar 2018, 02:15 PM

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

Tags
General Discussions
Asked by
Bernd
Top achievements
Rank 2
Answers by
Viktor Zhivkov
Telerik team
Bernd
Top achievements
Rank 2
Share this question
or