1
我讀過約翰·韋斯特的文章站點配置廠(http://www.sitecore.net/unitedkingdom/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/02/The-Sitecore-ASPNET-CMS-Configuration-Factory.aspx)Sitecore的配置工廠 - 有多個參數
我想在一個自定義鏈接提供商實現它調用方法。
我想配置工廠調用下面的方法中的鏈接提供者:
public void AddSitePath(String site, String path)
{
// do stuff
}
這裏的配置(雖然我試過幾個類似的變化)。
<add name="sitecore" type="MyProject.Providers.CustomLinkProvider, MyProject" addAspxExtension="false" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="never" languageLocation="filePath" shortenUrls="true" useDisplayName="false">
<sitePaths hint="list:AddSitePath">
<sitePath>
<site>SiteOneName</site>
<path>/product-range/</path>
</sitePath>
<sitePath >
<site>SiteTwoName</site>
<path>/items-for-sale/</path>
</sitePath>
</sitePaths>
</add >
我收到以下錯誤信息: 找不到添加方法:AddSitePath(類型:MyProject.Providers.CustomLinkProvider)
我懷疑問題是,我是試圖通過2參數加入到方法中,當然,當我使用單參數版本測試它時,它就可以工作。
我需要更改配置或類代碼以實現我需要的功能?