2012-03-05 79 views
1

在Composite C1中配置多個主機名時遇到問題。處理Composite C1中的多個主機名時出現異常

背景:
我在C1有兩個網站:site1和site2。 C1安裝主要針對site1,並與主機www.site1.com(和別名site1.com)一起使用。
現在我已將另一個站點site2添加到C1。當瀏覽到site1.com/site2時,我最終在site2網站上。一切都好。
然後我嘗試添加另一個主機名www.site2.com到URL配置 - >主機名。添加www.site2.com並瀏覽到www.site2.com後,我得到以下例外:「已添加項目。鍵入字典:''正在添加的鍵:''」

stacktrace看起來如下:

[ArgumentException:項目已被添加。鍵入字典:''鍵被添加:''] System.Collections.Hashtable.Insert(Object key,Object nvalue,Boolean add)+9353115 System.Collections.Hashtable.Add(Object key,Object value)+11 Composite.Core.Collections.Generic.Hashtable`2.Add(TKey key,TValue value)+105 Composite.Plugins.Routing.Pages.PageUrlBuilder.BuildUrlSet(IPage page,Guid parentPageId)+1935 Composite.Core.WebClient .Renderings.Page.PageStructureInfo.BuildFolderPaths(SitemapBuildingData pagesData,IEnumerable`1個元素,IDictionary`2 urlToIdLookup,IPageUrlBuilder構建器)+253 Composite.Core.WebClient.Renderings.Page.PageStructureInfo.BuildMap(UrlSpace urlSpace)+2200 Composite。 Core.WebClient.Renderings.Page.PageStructureInfo.GetMap(PublicationScope publicationScope,CultureInfo localizationS UrlSpace urlSpace)+482 Composite.Core.WebClient.Renderings.Page.PageStructureInfo.GetPageUrlBuilder(PublicationScope publicationScope,CultureInfo localizationScope,UrlSpace urlSpace)+9 Composite.Plugins.Routing.Pages.DefaultPageUrlProvider.ParseUrl(String relativeUrl,UrlSpace urlSpace,UrlKind&urlKind)+311 Composite.Plugins.Routing.Pages.DefaultPageUrlProvider.ParseUrl(String absoluteUrl,UrlKind&urlKind)+306 Composite.Core.Routing.Pages.C1PageRoute.GetRouteData(HttpContextBase context)+156 System.Web.Routing .RouteCollection.GetRouteData(HttpContextBase HttpContext的)287 System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase上下文)60 System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(對象發件人,EventArgs的)86 的System.Web。 SyncEvent ExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+148 System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,布爾和completedSynchronously)+75

有沒有人有一個解決方案?

在此先感謝...

UPDATE:
改變由梅德Dzygin建議的dll後,我得到了下面的堆棧跟蹤:

[ArgumentException的:項目已添加。鍵入字典:''鍵被添加:''] System.Collections.Hashtable.Insert(Object key,Object nvalue,Boolean add)+9353115 System.Collections.Hashtable.Add(Object key,Object value)+11 Composite.Core.Collections.Generic.Hashtable`2.Add(TKey key,TValue value)in c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ Collections \ Generic \ Hashtable.cs:28 Composite.Plugins.Routing.Pages.PageUrlBuilder。BuildUrlSet(IPage頁面,Guid parentPageId)位於c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Plugins \ Routing \ Pages \ PageUrlBuilder.cs中:190 Composite.Core.WebClient.Renderings.Page.PageStructureInfo。 c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ WebClient \ Renderings \ Page \ PageStructureInfo.cs:630 BuildFolderPaths(SitemapBuildingData pagesData,IEnumerable`1 elements,IDictionary`2 urlToIdLookup,IPageUrlBuilder builder)在c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \中創建Composite.Core.WebClient.Renderings.Page.PageStructureInfo.BuildFolderPaths(SitemapBuildingData pagesData,IEnumerable`1根,IPageUrlBuilder pageUrlBuilder,IDictionary`2 urlToIdLookup) WebClient \ Renderings \ Page \ PageStructureInfo.cs:612 Composite.Core.WebClient.Renderings.Page.PageStructureInfo.BuildMap(UrlSpace urlSpace)in c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ WebClient \ Renderings \ Page \ PageStructureInfo.cs:559 複製.Core.WebClient.Renderings.Page.PageStructureInfo.GetMap(PublicationScope publicationScope,CultureInfo localizationScope,UrlSpace urlSpace)位於c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ WebClient \ Renderings \ Page \ PageStructureInfo.cs:277 c:\ Builds \ 1 \ Freja中的Composite.Core.WebClient.Renderings.Page.PageStructureInfo.GetPageUrlBuilder(PublicationScope publicationScope,CultureInfo localizationScope,UrlSpace urlSpace) \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ WebClient \ Renderings \ Page \ PageStructureInfo.cs:342 c:\ Builds \ Composite.Plugins.Routing.Pages.DefaultPageUrlProvider.ParseUrl(String relativeUrl,UrlSpace urlSpace,UrlKind&urlKind) 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Plugins \ Routing \ Pages \ DefaultPageUrlProvider.cs:249 Composite.Plugins.Routing.Pages.DefaultPag在c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Plugins \ Routing \ Pages \ DefaultPageUrlProvider.cs中的eUrlProvider.ParseUrl(String absoluteUrl,UrlKind&urlKind):206 Composite.Core.Routing.Pages.C1PageRoute。 GetRouteData(HttpContextBase上下文)在c:\ Builds \ 1 \ Freja \ CodeplexBuild \ Sources \ Public \ Composite \ Core \ Routing \ Pages \ C1PageRoute.cs中:90 System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)+287 System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase上下文)60 System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(對象發件人,EventArgs的)86 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep。執行()+148 System.Web.HttpApplication.ExecuteStep(IExecutionStep步驟,Boolean和completedSynchronously) +75

回答

2

看起來像是某種類型的url碰撞,當2個C1頁面收到相同的url或類似的東西時。作爲解決方案,我建議您將調試版Composite.dll文件和Composite.pdf文件複製到您網站的/ bin文件夾中。您可以在Codeplex的發佈頁面(http://compositec1.codeplex.com/releases/view/80764)的「其他可用下載部分」中找到這些內容。之後,您將在代碼中看到引起它的確切行。一旦你有了它,我將能夠修復它或添加一些代碼斷言/驗證邏輯。

更新。

查看代碼,只有當您有2個網站具有空的「UrlTitle」字段時,纔會出現該例外。通常有驗證邏輯可以防止這種情況發生。嘗試編輯這兩個網站的根,給他們不是空的「網址標題」字段,然後發佈它們,這應該可以解決問題。如果錯誤仍然存​​在,我需要更好的repro(我沒有用提供的重現它),或者如果你給我一個網站的副本,我會調試它。

+0

謝謝你的迴應。更改DLL後,我得到以下堆棧跟蹤: – Tech 2012-03-07 10:30:16

+0

它是缺少的,你可以嘗試再次發佈它,或編輯原始問題 – 2012-03-07 10:46:45

+0

或電子郵件我ddz在composite.net – 2012-03-07 11:29:08