RainbowCodeGeneration不适用于Sitecore 9

时间:2017-11-22 11:19:06

标签: sitecore

您能否就下列问题提出建议?

我安装了Sitecore 9,Unicorn和Rainbow,项目已同步。 但是,当我尝试将最新的RainbowCodeGeneration添加到我的项目中时, 设置默认的.tt模板后,它会失败,但出现异常:

Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

在以下行:

var templates = RainbowCodeGeneration.RainbowReader.GetTemplates(physicalFileStore, treeName, treePath); 

我使用以下配置:

<#@ template debug="true" hostspecific="true"#>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<# // NOTE - Reference your NuGet packages for Rainbow and RainbowCodeGeneration here #>
<#@ assembly name="$(SolutionDir)packages\Rainbow.Core.2.0.0\lib\net452\Rainbow.dll" #>
<#@ assembly name="$(SolutionDir)packages\Rainbow.Storage.Yaml.2.0.0\lib\net452\Rainbow.Storage.Yaml.dll" #>
<#@ assembly name="$(SolutionDir)packages\RainbowCodeGeneration.0.2.0\lib\net452\RainbowCodeGeneration.dll" #>
<# // NOTE - Reference your Sitecore.Kernel.dll and Sitecore.Logging.dll here #>
<#@ assembly name="$(SolutionDir)\packages\Sitecore.Kernel.9.0.171002\lib\net462\Sitecore.Kernel.dll" #>
<#@ assembly name="$(SolutionDir)\packages\Sitecore.Logging.9.0.171002\lib\net462\Sitecore.Logging.dll" #>

1 个答案:

答案 0 :(得分:0)

我在RainbowCodeGeneration项目github上发布此问题后,创建了0.3版本。它现在支持Sitecore 9.

https://github.com/heikof/RainbowCodeGeneration/issues/4