Info only: how to get (and solve) a WPF DLL version problem

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Info only: how to get (and solve) a WPF DLL version problem

Post by ic2 »

Below a problem & how it was solved, some of you may find this useful. This has nothing to do with X# (it is a C# project even) but it seems a Visual Studio issue.

I use the Syncfusion Essential Wpf library for a PDF utility program. I found some issues in the PDFViewer and Syncfusion acknowledges and fixed those and eventually advised to install the weekly updates via NuGet. I was reluctant to do so because NuGet often meant trouble in the past, and this time again. The installation worked fine but I now had to add a license key in my code (which was not necessary for the regular installations from an exe) and that didn't work. Instead of finding out why, I decided for now to wait for a regular update and remove the NuGet installations via the Package manager in the VS Tools menu which worked. I removed the references and assigned the previous DLL's. But now my program wouldn't start; only in debugging mode I saw the message was Can't load Syncfusion.Shared.Wpf version 23.1460.42.0, which was the version supposed to be removed. But why?

I suspected the GAC (Storing something in the GAC cause comparable trouble as using NuGet) and de-installed syncfusionessentialwpf.exe, checked to remove GAC settings, reinstalled without copying anything into the GAC, copied all the DLL's I used, deleted and recreated the reference. However the problem remained.

Overnight Syncfusion support handed me the solution. In the App.config, I found these lines as they suspected:

Code: Select all

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.Shared.Wpf" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-23.1460.42.0" newVersion="23.1460.42.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
This was still pointing to the "42.0" removed version and apparently caused the problem. Removing this section solved my problem.

Dick
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Info only: how to get (and solve) a WPF DLL version problem

Post by wriedmann »

Hi Dick,
this is the cause why I don't use App.config at all - there are some things I don't like, for example login data to webservices and others.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Info only: how to get (and solve) a WPF DLL version problem

Post by ic2 »

Hello Wolfgang,

App.config is standard added to a WPF solution. You mean that you can just delete it (which would have prevented this issue)?

Dick
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Info only: how to get (and solve) a WPF DLL version problem

Post by wriedmann »

Hi Dick,
none of my WPF applications has a App.config file.
It ist only needed if your application needs to read some configuration data from it like database parameters or webservice access configurations.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply