Issue
Inside an existing solution, I use a DateTime control:
<Sharepoint:DateTimeControl ID="DateTimeControl1" dateonly="true" ShowWeekNumber="true" FirstDayOfWeek="1" FirstWeekOfYear="2" runat="server" EnableViewState="true"></sharepoint:DateTimeControl>
Instead of the date picker, i had the following error (An unexpected error has occurred):
In ULS logs:
Medium Application error when access /_layouts/15/iframe.aspx, Error=Object reference not set to an instance of an object. at Microsoft.SharePoint.Utilities.SPUtility.GetThemedImageUrl(String originalUrl, String themeKey) at Microsoft.SharePoint.WebControls.DatePicker..ctor() at Microsoft.SharePoint.WebControls.SPDatePickerControl.InitDatePicker() at Microsoft.SharePoint.WebControls.SPDatePickerControl.set_ShowWeekNumber(Boolean value) at Microsoft.SharePoint.ApplicationPages.DatePickerFrame.Page_Load(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Unexpected System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Utilities.SPUtility.GetThemedImageUrl(String originalUrl, String themeKey) at Microsoft.SharePoint.WebControls.DatePicker..ctor() at Microsoft.SharePoint.WebControls.SPDatePickerControl.InitDatePicker() at Microsoft.SharePoint.WebControls.SPDatePickerControl.set_ShowWeekNumber(Boolean value) at Microsoft.SharePoint.ApplicationPages.DatePickerFrame.Page_Load(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Solution
You need to create a root site collection (/).
Easy, but SharePoint is capricious as always.