Sitecore Nuget 配置

配置 Sitecore Nuget 包的路径

配置文件路径地址:C:\Users<username>\AppData\Roaming\NuGet\NuGet.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="sitecore" value="https://sitecore.myget.org/F/sc-packages/api/v3/index.json" />
  </packageSources>
</configuration>

注意:在 2023年11月之后 nuget 地址将迁移到 https://nuget.sitecore.com/resources/v3/index.json
| https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1002999
所以上面的xml 应该改为:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="sitecore" value="https://nuget.sitecore.com/resources/v3/index.json" />
  </packageSources>
</configuration>

项目的引用的dll要与 sitecore 一致

例如 sitecore 10.2 版本引用的 Microsoft.Aspnet.MVC.dll 版本为 5.2.4,而最新的 .Net Framework 4.8 里的 MVC 的模板默认引用的是 5.2.7 或 5.2.9,需要降级处理;

posted @ 2023-03-16 21:39  灵火  阅读(43)  评论(0编辑  收藏  举报