我安装了具有架构Asp.Net Mvc5.x和单页Web应用程序Angular JS的ASP.NET Boilerplate的免费启动模板
,当我运行已添加到模板的测试作为示例时,该示例称为“ Should_Get_Current_User_And_Tenant_When_Logged_In_As_Tenant()”,该示例在项目中找到 SpecificDownloadedProjectName.Tests
我收到错误
Could not load file or assembly 'Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
我当前的castle.core版本是v4.3.1
和Abp 3.8.3
,这些版本是NuGet软件包中最新可用的版本
我尝试通过NuGet软件包管理器将Castle.core更新为4.0.0,因为异常消息提到了该错误,但我无法解决以下错误
Severity Code Description Project File Line Suppression State
Error Unable to resolve dependencies. 'Castle.Core 4.0.0' is not compatible with 'Abp 3.8.3 constraint: Castle.Core (>= 4.3.1)', 'Castle.Core-log4net 4.3.1 constraint: Castle.Core (= 4.3.1)', 'Castle.DynamicProxy 2.2.0 constraint: Castle.Core (= 1.2.0)'. 0
我应该怎么做才能解决此异常
答案 0 :(得分:0)
这是Nuget的问题,它有时无法解决,因此您必须在web.config或app.config中手动添加以下行。您还必须确保行的顺序。
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.0.0.0" />
</dependentAssembly>
注意:您可以根据要求设置oldVersion和newVersion值。