SaaS CMS has officially launched! Learn more now.

EPiServer 7 Shell


Im trying to do a shell style application inside EPi.

Im using MVC with razor, but i have som issues.
Ive looked at this:

According to the example you use



but since i use razor i just did



However i get the error: Cannot perform runtime binding on a null reference

Am i missing something ?
I have the following usings:

@using EPiServer.Shell
@using EPiServer.Shell.Navigation
@using EPiServer.Shell.Web.UI
@using EPiServer.Shell.Web.Mvc.Html
@using EPiServer.Shell.Web.Resources


Nov 01, 2012 14:56

Try to add this using:

  • EPiServer.Framework.Web.Mvc.Html
  • EPiServer.Framework.Web.Resources

Could you provide stack trace?

Nov 02, 2012 9:23

Found a way after a lot of browsing of the EPi Binaries.
This seams to do the trick for me:

<!-- Shell -->
<!-- LightTheme -->
<!-- Navigation -->
<!-- Dojo Dashboard -->


Nov 02, 2012 9:23

Just for kicks i tried adding your suggested namespaces and the normal @Page.ClientResources("Shell") but still same error.
Here is a stack trace of it.

[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object , String ) +264
   System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +975
   CallSite.Target(Closure , CallSite , Object , String ) +373
   System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +975
   ASP._Page_Views_Shared_Sleek_cshtml.Execute() in c:\EPiServer\Sites\EPi7MVC\Views\Shared\Sleek.cshtml:87
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +89
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +233
   System.Web.WebPages.WebPageBase.PopContext() +282
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +384
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +33
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +970500
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +970320
   System.Web.Mvc.Controller.ExecuteCore() +159
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
   EPiServer.Shell.Web.Mvc.ModuleMvcHandler.ProcessController(IController controller) +50
   EPiServer.Shell.Web.Mvc.ModuleMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +28
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +405
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

But as i said in previous post, i found a way by directly use the static class ClientResources and then i got some pointers from javaconsole to change Shell to ShellCore and added ShellWidgets, and renamed ShellLightTheme to ShellCoreLightTheme, and also added DojoDashboardCompatibility. Now i got a good working top global navigation looking just like the real thing and no errors or warning in the console.

Nov 02, 2012 9:30

Exactly, you can make it shorter when adding usings:

@using EPiServer.Framework.Web.Resources



Nov 02, 2012 9:30

Yeah i know, did that afterwards. After confirming that it actually worked.

However the guide for this ( should be updated.

Not only is the Shell, and ShellLightTheme obselete.

The stuff needed to be changed and added is the following resources:
ShellCore (instead of obsolete: Shell)
ShellWidgets (new ?)
ShellCoreLightTheme (instead of obsolete: ShellLightTheme)
DojoDashboardCompatibility (new ?)

The Html.ShellInitializationScript() and Html.GlobalMenu() still works if you wrap them with Html.Raw().

Nov 02, 2012 9:37

Thanks for the report. I have added a bug to update the SDK for EPiServer 7.

Nov 02, 2012 9:55
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.