I was setting up a new port for SSL on my local development machine for added security on a client’s EPiServer 7.5 website when I stumbled across an exception that was not all at once obvious. I set up a new https binding in the IIS along with a self signed certificate; my normal unsecure site continued to respond just fine to calls on http://localhost:17002/ after this. However, when I tried accessing it through https://localhost:17004/, which was what I had selected for SSL I got hit with the parameter-does-not-have-a-value exception below.
NOTE: Also see Ted Nybergs comment about scheduled jobs below.
Message: The provided content link does not have a value. Parameter name: contentLink StackTrace: at EPiServer.DataFactory.Get[T](ContentReference contentLink, ILanguageSelector languageSelector) at EPiServer.DataFactory.Get[T](ContentReference contentLink) at Xxxxx.Web.Helpers.ResultFilters.PageContextActionFilter .OnResultExecuting(ResultExecutingContext filterContext) in c:\Projekt\MyProject\Xxxxx.Web\Helpers \ResultFilters\PageContextActionFilter.cs:line 80 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.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web .HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
After some debugging it turned out that it was EPiServer’s ContentReference.StartPage that was not set correctly; it was just empty.
The solution for this is really rather simple. Turns out that I had forgot to set the corresponding host name binding in EPiServer’s admin mode. Adding an entry containing the proper https port number fixed it right up.


7 responses to “EPiServer’s ContentReference.StartPage is an empty reference when lacking binding”
Good tip!
You may run into similar problems in scheduled jobs. One way around it is to add a wildcard binding (“*”) for your default site.
That will then be your default site definition (as in SiteDefinition.Current.StartPage or ContentReference.StartPage) when there’s no current site, or outside of web requests.
Thanks Ted! I just ran into it building a scheduled job, and remembered that you commented something about it :)
Great tips Ted! Thanks =)
Thanks Ted, this comment helped me out when doing som initalization stuff
Tanks to both of you!
Thanks for the “*” binding tip, Ted! Saved my day as a scheduled job was causing some headache.
So glad I found this post!
“*” solved our problems with a scheduled job.