Using App.Config to Point to Different Version of Assembly

  • Thread starter Thread starter Lanis Ossman
  • Start date Start date
L

Lanis Ossman

Guest
I have a Windows application using older versions of some Microsoft DLLs. I had to use a newer version for one project only. I am not at liberty to change the entire application, at this point.

I used codeBase in my App.Config, and as long as I point to the entire application and assembly path, it works.

<codeBase version="15.0.0.0" href="file:///C:/Builds/CAD//Microsoft/Version 15_0_0_0/Microsoft.ReportViewer.Winforms.DLL"/>

However, I need to use relative pathing to the application folder, which can vary from client to client. I tried all the .\, ..\, ~\, etc., but nothing works. Can't find the assemblies. I suspect the base folder is not my application folder, but rather C:\Windows\System32.

I also tried Probing

<probing privatePath="Microsoft\Version 14_0_0_0;Microsoft\Version 15_0_0_0"/>

But, per FusLogVw.Exe, keeps trying to apply the older DLL versions, which happen to be in the application root folder.

LOG: Assembly Name is: Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91


Note: I'm after version 15, but Probing tried version 11.

I would rather not fix this in code, as config files are more easily adaptable if assembly requirements change in the future.

NOTE: I also added references to the newer assemblies in the project.

Ideas?

Continue reading...
 
Back
Top