Sitecore Razor Intellisense - 防止发布

时间:2017-05-28 14:18:46

标签: visual-studio sitecore

我现在开始学习Sitecore开发,并在设置我的解决方案后发现Intellisense没有选择Sitecore相关的类。

我还已将Sitecore.Mvc.dll和Sitecore.Kernel.dll添加到我的参考文件夹中。

我尝试使用VS 2015/2017的相同步骤创建新项目无济于事。

在发布时,这些将变成错误,因此解决方案将不会发布。

感谢先进的任何帮助!

enter image description here

2 个答案:

答案 0 :(得分:0)

System.Web.Mvc 5.1.0.0System.Web.Mvc 5.2.3.0之间似乎存在版本冲突。最后一个用于Sitecore 8.1 and later

您应该将代码中引用的版本与所需版本对齐,或者配置assembly bindings

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

答案 1 :(得分:0)

修复显然是升级到.NET Framework 4.6 。 我的Sitecore实例是 Sitecore版本8.2

我最初的.NET框架是4.5.2,它实际上也与Sitecore 8.2兼容,但是当我将.NET Framework升级到4.6时,我不知道为什么它突然起作用。我在2个项目上重新尝试了它并且有相同的行为。

以下是Sitecore网站的屏幕截图,显示了Sitecore 8.2与ASP.NET框架版本的兼容性。enter image description here