web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.

(3) ShareShare
ReportReport
Posted on by 197
Hello all,
 
While working on a report with my own data, I'm receiving the following build error:
An unhandled exception was thrown while validating WWIFreeTextInvoice with callstack System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate
I've looked for similar post here in the community, but due to the software change in the community hosting software the links in some other posts are broken.
 
How do I begin to track down the source of this error?
What can I do to eliminate this error?
 
Thanks in advance.
I have the same question (0)
  • Suggested answer
    Syed Amir Ali Profile Picture
    137 on at
    Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.
    Hey, 

    I encountered a similar issue while working with an SSRS report.

    How did it occur?

    The error appeared when I duplicated an existing SSRS report into my project/model. After renaming the data source and attempting to deploy the report, I received the following error:

    "Unhandled exception. System.InvalidOperationException: Sequence contains no matching element."

    What was unusual?


    The original report I duplicated had a spelling mistake in the data source name, which was also used throughout the report design. However, when I created the duplicate, I corrected the spelling of the data source name in the code but didn’t update the name in the report design itself.

     

    After correcting the spelling in the report design to match the updated data source name, I was able to deploy the report successfully and it worked as expected.

  • jt1024 Profile Picture
    197 on at
    Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.
    So this post was a follow on to https://community.dynamics.com/forums/thread/details/?threadid=3bf9af4d-1557-ee11-be6f-00224827e8f9, and in that post I wrapped it up by describing how I side-stepped the problem.  I still don't know what was up with this:
    An unhandled exception was thrown while validating WWIFreeTextInvoice with callstack System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate"
    error.
     
    I think it's basically a SNAFU.
     
    - Jim
  • jt1024 Profile Picture
    197 on at
    Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.
    This is the full error list window for this:
     
    If I'm reading this correctly it seems the next things I should investigate are what this line is telling me:
    Microsoft.Dynamics.AX.Metadata.Extensions.Reports.AxReportDataSetParameterExtensions.GetAssociatedReportParameter(AxReportDataSetParameter datasetParameter, AxReport report)
    Which lead to the:
    Error        Path: [AxReport/WWIFreeTextInvoice]:"An unhandled exception was thrown while validating WWIFreeTextInvoice with callstack System.InvalidOperationException: Sequence contains no matching element
       at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
     
    If anyone has any tips or ideas on how to investigate and solve this it would be greatly appreciated.  I feel like I'm blind folded, in the dark, in a barn looking for a needle in a giant haystack.
     
    - Jim
  • Martin Dráb Profile Picture
    236,118 Most Valuable Professional on at
    Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.
    Hana's answer is completely off-topic. It's about Telerik Sitefinity, not Microsoft Dynamics.
  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at
    Unhandled exception. System.InvalidOperationException: Sequence contains no matching element.
    Hi,
    I found a problem similar to yours,

    It mentioned that the reason for this issue may be that the page template used on the page is based on missing layout files.
    And a solution was provided, you can try it:
    1. Go to the Pages view and check the template of the problematic page.
    2. Go to Design>Page templates and check based which Layout file the template is based on.
    3. Go to the dedicated folder and ensure that the file is not missing (e.g., ResourcePackages\ Bootstrap\ MVC\ Views \Layouts)
    Best Regards,
    Hana
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,132

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 778 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 739 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans