我一直试图设置一个示例Prism项目,但是我陷入了以下错误。 似乎在搜索更高版本的程序集的版本。
我尝试清理项目,并删除npm软件包,但注意似乎有所帮助。
System.Windows.Markup.XamlParseException:'无法加载文件或程序集'Prism.Wpf,版本= 7.1.0.172,文化=中性,PublicKeyToken = 40ee6c3a2184dc59'或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040)'
这些是添加到项目中的软件包。
<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>
任何建议如何解决此问题?
答案 0 :(得分:0)
我找到了引用,它是App.Config的一部分
我已经 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>