2012-09-06 68 views
4

即將跨越怪異Sitecore的錯誤Sitecore的6.6」不存在命名空間存在’應用的佈局採用MVC的一對夫婦不同的內容和我收到此錯誤:「內核Sitecore的‘

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\95ad0ba4\20f230f7\App_Web__sitecorelayout.cshtml.5d96958d.682ppzj_.0.cs(24): error CS0234: The type or namespace name 'Kernel' does not exist in the namespace 'Sitecore' (are you missing an assembly reference?) 

System.Web.HttpCompileException (0x80004005): c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\95ad0ba4\20f230f7\App_Web__sitecorelayout.cshtml.5d96958d.682ppzj_.0.cs(24): error CS0234: The type or namespace name 'Kernel' does not exist in the namespace 'Sitecore' (are you missing an assembly reference?) 
at System.Web.Compilation.AssemblyBuilder.Compile() 
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() 
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) 
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) 
at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath) 
at System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromSpecificName(ControllerContext controllerContext, String name, String cacheKey, String[]& searchedLocations) 
at System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations) 
at System.Web.Mvc.VirtualPathProviderViewEngine.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache) 
at System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths) 
at System.Web.Mvc.HtmlHelper.FindPartialView(ViewContext viewContext, String partialViewName, ViewEngineCollection viewEngineCollection) 
at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) 
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) 
at Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) 
at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) 
at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) 
at (Object , Object[]) 
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) 
at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args) 
at Sitecore.Mvc.Presentation.RenderingView.Render(ViewContext viewContext, TextWriter writer) 
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) 
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.b__19() 
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) 
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) 
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) 
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) 

事情被設置爲IIS內部的構建和應用程序池的4框架我很茫然,這是否發生在同一場景中的任何人?

+0

在您的bin目錄中是Sitecore.Kernel.dll嗎? – raynjamin

+0

是的,它在bin目錄中。 – mservais

回答

7

該問題是由於在Views目錄中的web.config文件的命名空間部分中添加了Sitecore.Kernel命名空間。刪除解決了這個問題。

使用Sitecore支持來解決問題。大概在半小時前就明白了。

0

因爲它是動態編譯的, sitecore dlls到臨時的ASP.NET文件夾,因爲顯然它是錯誤發生在編譯和不運行時,因此在bin中沒有問題?只是一個猜測。

如果這不起作用,可能檢查版本或嘗試刪除臨時ASP.NET文件夾中的所有內容,然後重試。

0

我有同樣的問題。右鍵點擊References文件夾 - >添加引用 - >瀏覽 - >從您的bin文件夾(在您的項目中)選擇Sitecore.Kernel - >再次構建解決方案。

0

我的問題是目標框架。當我遇到這個問題時,我在.NET 4.5上。我升級到.NET 4.6並且問題消失了。