Blazor Succinctly Help Desk Example - error with version 18.2.0.54

I have run into problems following the Help Desk example in the Blazor Succinctly book.  All was going well until I got to try the 'Edit' and 'Delete' buttons on the Administration grid (page 72).  At this point I got the error shown in full below that I couldn't resolve.

I downloaded the complete source from the github page (https://github.com/ADefWebserver/SyncfusionHelpDesk)and ran it without problems.

Using the NuGet package manager I upgraded the Microsoft packages from 3.1.2 to 3.1.7, and System.Text.Json to 4.7.2  The program ran without problems.

However, when I upgraded Synfusion.Blazor from 18.1.0.42 to 18.2.0.54 the error occurred.

I feel the problem is related to the latest (or recent) release of Syncfusion.Blazor



ERROR - Line 121/122 of Administration.razor

System.InvalidOperationException
  HResult=0x80131509
  Message=Invalid attempt to call ReadAsync when reader is closed.
  Source=Microsoft.Data.SqlClient
  StackTrace:
   at Microsoft.Data.Common.ADP.ExceptionWithStackTrace(Exception e)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<MoveNextAsync>d__17.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.<SingleOrDefaultAsync>d__22`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.<SingleOrDefaultAsync>d__22`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at SyncfusionHelpDesk.Data.SyncfusionHelpDeskService.<GetHelpDeskTicketAsync>d__3.MoveNext() in C:\Users\Christopher\OneDrive - XXX\Blazor\SyncfusionHelpDesk-main\SyncfusionHelpDesk-main\Data\SyncfusionHelpDeskService.cs:line 35
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at SyncfusionHelpDesk.Pages.Administration.<OnCommandClicked>d__20.MoveNext() in C:\Users\Christopher\OneDrive - XXX\Blazor\SyncfusionHelpDesk-main\SyncfusionHelpDesk-main\Pages\Administration.razor:line 121

  This exception was originally thrown at this call stack:
    [External Code]
    SyncfusionHelpDesk.Data.SyncfusionHelpDeskService.GetHelpDeskTicketAsync(string) in SyncfusionHelpDeskService.cs
    [External Code]
    SyncfusionHelpDesk.Pages.Administration.OnCommandClicked(Syncfusion.Blazor.Grids.CommandClickEventArgs<SyncfusionHelpDesk.Data.HelpDeskTickets>) in Administration.razor

8 Replies 1 reply marked as answer

SU Sridurgha Uthayakumaran Syncfusion Team September 3, 2020 04:31 PM UTC

Hi Christopher, 

Sorry for the delay in getting back. 

We have validated the reported issue and we could not reproduce the same in v18.2.0.54 and also in latest v18.2.0.56. We have taken a video which demonstrates the process in Administrator page without any error and the same can be referred from the below link. 


Could you please get back to us with more information to replicate this issue such as a detailed description of the issue with the issue replication procedure, screenshots, or any other pictorial representation of the issue and scenario faced in your end so that it will be helpful for us to validate and provide the solution at the earliest? 

Regards, 
Sridurgha U  



CB Christopher Bell September 4, 2020 09:17 AM UTC

HiSridurgha

Many thanks for your reply, but I am still experiencing the problem.

These are the steps to reproduce the problem:

Download zipped file from ADefWebserver/SyncfusionHelpDesk on github

Unzip and save into a folder called "SyncfusionHelpDesk" on the Desktop.

Open Visual Studio 2019, browse to the .sln file

Open appsettings.json and edit the "Default Connection"


The downloaded solution was built with version 18.1.042 of Syncfusion.Blazor. Obtain licence key for this version and edit Startup.cs to include the licence.

Build and run the application. Login as administrator@email and select Administration and Delete a record. It works perfectly. (I am using Microsoft Edge)

So far, so good...

Select Project > Manage NuGet Packages

Update Syncfusion.Blazor to version 18.2.0.56

Obtain licence key for version 18.2.0.56 and edit Startup.cs to update the licence key.

Build and run the application - it fails with error: System.InvalidOperationException: 'Invalid attempt to call ReadAsync when reader is closed.'

===================================================================

Reproduced on a second PC, with additional step of creating the SQL database, and running the SQL Script 01.00.00.sql from the !SQL Scripts folder from the downloaded solution, and then adding a few tickets. It also works with 18.1.0.42, but fails with 18.2.0.56

I attach a video that shows the problem. If you need any further information please let me know and I will be very happy to help.

Thanks in advance

Regards

Chris


Attachment: SyncfusionDeleteError_1ea100a7.zip


SU Sridurgha Uthayakumaran Syncfusion Team September 9, 2020 03:33 PM UTC

Hi Christopher, 

Thanks for your update. 

We are able to reproduce the issue in our end and we are validating the same. We will provide further update on this by 11th September, 2020 until then we appreciate your patience. 

Please let us know if you have any concerns. 

Regards, 
Sridurgha U 



CB Christopher Bell September 9, 2020 04:49 PM UTC

Hi Sridurgha

Thank you for your reply.

There is no urgency from my perspective as it works with 18.1.0.42. so I'm happy to wait.

Kind regards

Chris


SU Sridurgha Uthayakumaran Syncfusion Team September 10, 2020 02:59 PM UTC

Hi Christopher, 

Thanks for your update. 

As promised we will update the details on this by September 11, 2020. 

Regards, 
Sridurgha U 



VN Vignesh Natarajan Syncfusion Team September 11, 2020 01:03 PM UTC

Hi Christopher,  
  
Thanks for the patience.  
  
Query: “Build and run the application - it fails with error: System.InvalidOperationException: 'Invalid attempt to call ReadAsync when reader is closed.' 
  
We have validated the reported issue at our end and found that the exception is thrown from EntityFramework core. It occur due to GetHelpDeskTicketAsync method being considered as Asynchronous method instead of synchronous process. Hence the reported issue has occurred when trying to fetch the selected record from database. We have modified that method to be synchronous process to resolve the issue.  
  
After resolving the reported issue, we have face some issue (not consistent) while deleting the record for second time in Grid. So we have modified the DeleteConfirmYes method to fetch of updated records from database instead of refreshing the Grid.  Similarly we have modified the Update method also.  
  
Please find the modified sample from below  
  
 
Please get back to us if you have further queries.     
  
Regards, 
Vignesh Natarajan 


Marked as answer

CB Christopher Bell September 16, 2020 10:41 AM UTC

Hi Vignesh

Thank you for your reply and my apologies for the delay in me responding.

I can confirm that the revised code works for me.

Best wishes

Chris


VN Vignesh Natarajan Syncfusion Team September 17, 2020 05:00 AM UTC

 
Thanks for the update.  
 
We are glad to hear that you have resolved your query using our solution.  
 
Kindly get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan       


Loader.
Up arrow icon