Scaffold makes cshtml not razor

I'm using the scaffold command line because of the previously reported MS bug, to make a DataGrid page, the scaffolding completes but it makes a cshtml page with an ejs_grid instead of a razor page with a DataGrid control. It seems like its getting the project type wrong, which is a Blazor server side project made with the wizard.
The command does report an exception:
Scaffolding failed with these exception:System.NullReferenceException: Object reference not set to an instance of an object.
   at syncfusion_scaffolding.Model.GetEntitySet(String dbContextTypeName, String dbModelTypeName, String projectName) in D:\2\vsext_scaffolding_command_line\Model.cs:line 139
but carries on and makes the Controller and cshtml view

2 Replies 1 reply marked as answer

AD Abishake Dakshinamoorthy Syncfusion Team June 17, 2021 08:43 AM UTC

Hi Gary, 
  
  
We can reproduce this issue when application have Views and Controllers folder. We logged this as bug report and fixed on upcoming 2021 Essential Studio Volume 2 release. You can track this issue from below link 
  

You can use the Syncfusion Blazor Code Generator for the workaround until we resolved. 
  

For “Object reference not set to an instance of an object” exception, could you please clean and build the application before performing the Syncfusion Scaffolding command-line? 
  

Regards, 
Abishake Dakshinamoorthy 



AD Abishake Dakshinamoorthy Syncfusion Team June 30, 2021 08:41 AM UTC

Hi Gary,  

We are glad to announce that our Essential Studio 2021 Volume 2 release v19.2.0.44 is rolled out with this fix. 
  

Could you please do the following steps to update Syncfusion Scaffolding command-line tool in your machine and perform the Syncfusion Scaffolding command-line for your application? 
  
1.      Open the command prompt with administrator privilege 
  
2.      Give this below command in command prompt
      dotnet tool update -g syncfusion.scaffolding 
  
  
 We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
  

 Regards, 
Abishake Dakshinamoorthy 


Marked as answer
Loader.
Up arrow icon