Asp.net mvc 4 新MVC4解决方案,添加食人鱼CMS,缺少组件
我刚刚创建了一个新的MVC4站点,按run查看它是否工作,然后运行命令: 安装PiranhaCMS.Mvc包 然后再次按run。 这将导致显示以下错误: 无法加载文件或程序集'DotNetOpenAuth.Core,版本=4.0.0.0, 区域性=中性,PublicKeyToken=2780ccd10d57b246'或其 依赖关系。定位程序集的清单定义不正确 匹配程序集引用。(来自HRESULT的异常:0x8013100) 我尝试了这个线程中所有高投票率的解决方案,除了那些涉及删除OAuth的解决方案(因为我想使用它)Asp.net mvc 4 新MVC4解决方案,添加食人鱼CMS,缺少组件,asp.net-mvc-4,oauth,piranha-cms,Asp.net Mvc 4,Oauth,Piranha Cms,我刚刚创建了一个新的MVC4站点,按run查看它是否工作,然后运行命令: 安装PiranhaCMS.Mvc包 然后再次按run。 这将导致显示以下错误: 无法加载文件或程序集'DotNetOpenAuth.Core,版本=4.0.0.0, 区域性=中性,PublicKeyToken=2780ccd10d57b246'或其 依赖关系。定位程序集的清单定义不正确 匹配程序集引用。(来自HRESULT的异常:0x8013100) 我尝试了这个线程中所有高投票率的解决方案,除了那些涉及删除OAuth的解
- 删除bin和obj文件夹
- 使用安装包Microsoft.AspNet.WebPages.Oauth重新安装Oauth
- 清洁溶液(结合其他两个选项)
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
新的
我猜食人鱼正在改变MVC4假设的可用性,而不是DLL本身
编辑2
看起来食人鱼已经从几个dependentAssembly节点中删除了1(如上面的编辑中所示)。问题是我能不能把它们换回来,或者换成食人鱼的话
编辑3
将旧值粘贴回去可以解决此问题。。我的网站现在显示了“安装新网站”屏幕。但仍然不确定这是否破坏了其他任何东西
在web.config中将的内容替换为:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
也不得不评论出这句话
:
如果有人知道什么是错误的,如果我的“修复”是一个很好的解决方案,那将是一个很好的答案。食人鱼CMS本身不使用ASP.NET标识,所以正如您注意到的,它与运行时程序集绑定有关。NuGet 2.7有一个bug,导致在安装ASP.NET MVC包时web.config中缺少运行时绑定。这导致应用程序在本地计算机上安装多个版本的Razor/WebPages/MVC()时崩溃 为了解决这个问题,也就是让我免于太多的支持,这些缺失的行被添加到Piranha NuGet包的web.config.transform中 我的猜测是,NuGet的新版本已经解决了这些问题,并且绑定中出现了某种形式的冲突,因此您使用原始行替换修改后的行的方法是正确的 我将看看是否可以在NuGet for 2.1.x上发布一个服务版本,并从NuGet包中删除运行时绑定 问候 /赫坎
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>