Skip to main content

Notifications

Power Pages - General Discussions
Answered

Error when making a search on Power Pages - YSOD

(0) ShareShare
ReportReport
Posted on by 101

Could someone please help me understand this error:

[NullReferenceException: Object reference not set to an instance of an object.]
 Adxstudio.Xrm.Search.DataverseSearch.Providers.Filters.KnowledgeArticleFilterConfigProvider.TryGetLanguageCode(String& languageID) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\Providers\Filters\KnowledgeArticleFilterConfigProvider.cs:78
 Adxstudio.Xrm.Search.DataverseSearch.Providers.Filters.KnowledgeArticleFilterConfigProvider.GetFilters(IEnumerable`1 facetConstraints) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\Providers\Filters\KnowledgeArticleFilterConfigProvider.cs:37
 Adxstudio.Xrm.Search.DataverseSearch.Providers.DataverseSearchFilterProvider.GetFilters(String entityName, IEnumerable`1 facetConstraints) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\Providers\DataverseSearchFilterProvider.cs:54
 Adxstudio.Xrm.Search.DataverseSearch.Providers.SearchEntityProvider.GetEntity(String entityName, IEnumerable`1 facetConstraints) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\Providers\SearchEntityProvider.cs:55
 Adxstudio.Xrm.Search.DataverseSearch.Providers.SearchEntityCollectionProvider.GetEntitiesList(List`1 logicalNames, IEnumerable`1 facetConstraints) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\Providers\SearchEntityCollectionProvider.cs:61
 Adxstudio.Xrm.Search.DataverseSearch.DataverseSearchQuery..ctor(String queryText, Int32 pageNumber, Int32 pageSize, String filter, List`1 logicalNames, IWebsiteLanguage language, Boolean multiLanguageEnabled, Int32 postProcessingLimit, IEnumerable`1 facetConstraints, Boolean isFacetedSearch, Boolean isGlobalSearch, String sortingOption, Int32 top, Int32 skip) in C:\__w\1\s\Framework\Adxstudio.Xrm\Search\DataverseSearch\DataverseSearchQuery.cs:84
 Adxstudio.Xrm.Web.UI.WebControls.SearchDataSourceView.ExecuteSelect(DataSourceSelectArguments args) in C:\__w\1\s\Framework\Adxstudio.Xrm\Web\UI\WebControls\SearchDataSourceView.cs:69
 Adxstudio.Xrm.Web.UI.WebControls.SearchDataSourceInfoView.ExecuteSelect(DataSourceSelectArguments args) in C:\__w\1\s\Framework\Adxstudio.Xrm\Web\UI\WebControls\SearchDataSourceInfoView.cs:17
 System.Web.UI.WebControls.Repeater.GetData() +335
 System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +286
 System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +79
 System.Web.UI.WebControls.Repeater.EnsureDataBound() +142
 System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +19
 System.Web.UI.Control.PreRenderRecursiveInternal() +199
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Control.PreRenderRecursiveInternal() +296
 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7478

 

I setup the global search/dataverse search for my portal (a blank template) and after successfully making queries from some custom tables, I decided to query the Knowledge Article table which I added to my solution. Since then, I have been receiving this error. I removed the KA from my solution and renamed the search view, so it does not get indexed. I have been stuck on this for the past 5 days.

Categories:
  • Verified answer
    aofosu Profile Picture
    aofosu 101 on at
    Re: Error when making a search on Power Pages - YSOD

    I was able to resolve this issue by doing the following steps:

    1. Removing the Knowledge Article table from the Dataverse Search Index (because I am using the Blank Template this feature is not searchable as the Content Access Level feature is not present)
    2. Setting this site settings "KnowledgeManagement/ContentAccessLevel/Enabled" to false
    3. Adding a MIME type "text/html" to the web template that renders the search results (this is because I have the "HTTP/X-Content-Type-Options" header set to "nosniff")

    I hope this helps if you do encounter this same error if you are not using any of the recommended Dynamics 365 templates that support the knowledge articles. 

    Workaround:
    Based on the client's requirements we decided to create custom tables to separate KA for anonymous and authenticated users. Then using the liquid searchindex we assign different logical names depending on the user type. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard