1
votes

I've been trying to setup a sample Prism project, but i'm stuck at the following error. It looks like it searching for a version of the assembly of a later version.

I've tried cleaning the project, and removing the npm packages, but noting seems to help.

System.Windows.Markup.XamlParseException: 'Could not load file or assembly 'Prism.Wpf, Version=7.1.0.172, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

These are the packages added to the project.

<packages>
  <package id="CommonServiceLocator" version="1.4.0" targetFramework="net461" />
  <package id="MaterialDesignColors" version="1.1.2" targetFramework="net461" />
  <package id="MaterialDesignThemes" version="2.4.0.1044" targetFramework="net461" />
  <package id="Prism.Core" version="6.3.0" targetFramework="net461" />
  <package id="Prism.Unity" version="6.3.0" targetFramework="net461" />
  <package id="Prism.Wpf" version="6.3.0" targetFramework="net461" />
  <package id="Unity" version="4.0.1" targetFramework="net461" />
  <package id="Unity.Abstractions" version="3.3.0" targetFramework="net461" />
  <package id="Unity.Container" version="5.8.6" targetFramework="net461" />
</packages>

Any suggestions how to resolve this issue?

1
Can you post the xaml that causes the error? You might have an assembly reference there.Haukinger

1 Answers

2
votes

I've found the reference and it was part of the App.Config

I've App.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Prism" publicKeyToken="40ee6c3a2184dc59" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-7.1.0.172" newVersion="7.1.0.172" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Unity.Abstractions" publicKeyToken="6d32ff45e0ccc69f" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Unity.Container" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Prism.Wpf" publicKeyToken="40ee6c3a2184dc59" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-7.1.0.172" newVersion="7.1.0.172" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.1.0" newVersion="2.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>