I upgraded Kentico from version 8.2 to 9.0. Now getting the following error.
Hint 'noexpand' on object 'View_CMS_Tree_Joined' is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Hint 'noexpand' on object 'View_CMS_Tree_Joined' is invalid.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Hint 'noexpand' on object 'View_CMS_Tree_Joined' is invalid.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +392 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +61 System.Data.SqlClient.SqlDataReader.get_MetaData() +138 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6738869 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +6741487 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +586 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +107 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +288 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +180 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +21 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +325 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +420 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +278 CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) +261
SELECT [NodeAliasPath], [DocumentURLPath], [NodeID], [DocumentCulture] FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON V.NodeSKUID = S.SKUID WHERE (NodeSiteID = 1) AND ([DocumentURLPath] LIKE @DocumentURLPath OR [DocumentURLPath] LIKE @DocumentURLPath1)
Caused exception: Hint 'noexpand' on object 'View_CMS_Tree_Joined' is invalid. ] CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex) +181 CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) +776 CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query) +383 CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query) +401 CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords) +75 CMS.DataEngine.DataQueryBase1.GetDataFromDBInternal() +143 CMS.DataEngine.DataQueryBase1.GetDataFromDB() +96 CMS.DataEngine.DataQueryBase1.GetData() +149 CMS.DataEngine.DataQueryBase1.get_Result() +114 CMS.DataEngine.ObjectQueryBase2.GetResults(IDataQuery query, Int32& totalRecords) +41 CMS.DataEngine.DataQueryBase1.GetDataFromDB() +128 CMS.DocumentEngine.DocumentQueryBase2.