2011-09-07 30 views
2

我有Sitecore作爲網站根(這是運行正常),並在它下面,我需要有一堆asp.net應用程序運行。運行Sitecore的Asp.net應用程序錯誤6.4.1

到目前爲止,爲子應用程序創建了一個虛擬目錄,將其轉化爲應用程序。但是,一旦我瀏覽子應用程序,它就會出現此錯誤消息。

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0246: The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?) 

Source Error: 



Line 3264:   </providers> 
Line 3265:  </roleManager> 
Line 3266:  <profile defaultProvider="sql" enabled="true" inherits="Sitecore.Security.UserProfile, Sitecore.Kernel"> 
Line 3267:   <providers> 
Line 3268:    <clear/> 

看來,子asp.net應用程序正在繼承來自Sitecore web.config的Sitecore設置。

任何想法?

+0

儘管這允許我在Sitecore網站下運行子asp.net應用程序和Web服務,但它也在Sitecore中打破了一些東西。例如,富文本編輯器控件不會加載。 (它是Sitecore使用的Telerik控件之一)。只要我刪除Sitecore web.config中的位置標籤,與Telerik富文本編輯器相關的錯誤就消失了。所以我想這個問題至少會持續存在。 –

回答

1

這應該是可以的。您必須在虛擬目錄中爲該非Sitecore應用程序創建web.config,並覆蓋參考Sitecore類的<system.web><system.webserver>下的部分。這包括:

  • 的HttpModules/HttpHandlers的(對於這些,你應該「刪除所有」,並添加那些Web應用程序的)
  • 安全部分(把默認的ASP.NET提供程序類背面)
  • 在Sitecore的主要web.config中這個Web應用程序的路徑添加到IgnoreUrlPrefixes設置讓Sitecore的知道它不應該處理請求那些

這可能是別的東西,但你應該得到一般的想法。

+0

完美,這是解決方案。謝謝!我還用這篇文章介紹了一些細節。 http://sitecoreblog.alexshyba.com/2009/05/standalone-apps-under-sitecore-web-root.html –

+0

很高興知道!我建議你訂閱亞歷克斯的博客 - 這裏有很多有用的東西:) –

+0

必須回滾到Sitecore的原始設置,因爲富文本編輯器控件無法加載到Sitecore中。我已經在子asp.net應用程序中留下標籤來覆蓋IgnoreUrlPrefixes中的Sitecore設置和值,但必須移除圍繞

1

這個答案和Yan很類似,但是對於一個單獨的答案是不同的。希望能幫助到你。

進入IIS並選擇子應用程序。選擇模塊。刪除所有存在的Sitecore相關模塊。別擔心,父級Sitecore應用程序仍然會保留這些模塊。 Sitecore modules in IIS

當你這樣做時,你實際上正在改變子應用web.config,所以你會看到在web.config文件中刪除的元素就像這樣。

<remove name="SitecoreConfigWatcher" /> 
<remove name="SitecoreHttpModule" /> 

您還可能需要清除一些其他的繼承設置。

<profile enabled="false"><providers><clear/></providers></profile> 
<roleManager enabled="false"><providers><clear /></providers></roleManager>