Base solution for your next web application

Activities of "ISTeam"

We are using version 8.1.0 template of ASP .NET Core MVC & jQuery type. As per this documentation of MVC, I tried to add 'Address' field in my project.

It compiles successfully and I can also see 'Address' field in swagger UI call of "/api/services/app/User/GetUsers" api method response.

But when I load the 'Users' page in the 'Administration' tab with my 'admin' login in dev environment I am getting below error: "DataTables warning: table id=UsersTable - Requested unknown parameter '10' for row 0, column 10. For more information about this error, please see http://datatables.net/tn/4"

On UI one column 'Address' is added but data is not reflecting and as 'Address' is not being bind correctly last column 'Creation Time' is empty. It seems column is added in UI as I have defined column in /Users/index.cshtml but it is not being bound correctly via JS.

I have updated below files with 'Address' column:

  1. .Application.Shared/Authorization/Users/Dto/UserEditDto.cs
  2. .Application/Authorization/Users/Exporting/UserListExcelExporter.cs
  3. .Application/Authorization/Users/UserAppService.cs
  4. .Core.Shared/Authorization/Users/UserConsts.cs
  5. .Core/Authorization/Users/User.cs
  6. .Web.Mvc\Areas\App\Views\Users_CreateOrEditModal.cshtml
  7. .Web.Mvc/Areas/App/Views/Users/Index.cshtml
  8. .Web.Mvc/Areas/App/Views/Users/_CreateOrEditModal.cshtml
  9. .Web.Mvc/wwwroot/view-resources/Areas/App/Views/Users/Index.js
  10. .Web.Mvc/wwwroot/view-resources/Areas/App/Views/Users/Index.min.js
  11. .Web.Mvc\wwwroot\view-resources\Areas\App\Views_Bundles\user-list.min.js

When I create a new user from Create popup, it saves the address correctly in the database and I added dummy address for all existing 5 users and in the DB entity its not set as 'Required' field.

Please advice. Thnx.

Answer

To fix this error, I found that ef is not by default included in .NET 3.0 onward releases. So, if we are using .NET Core 3.x then we have to add ef tool packages additionally unlike .NET Core 2.2.

Below were my first two steps in CI pipeline of Azure DevOps but these can be anywhere before the efcore-migration-script-generator task.

steps:

If its .NET Core 3.x

  • task: UseDotNet@2 displayName: 'Use .NET Core sdk 3.x' inputs: packageType: sdk version: 3.x installationPath: $(Agent.ToolsDirectory)/dotnet

For db migration script generator this dependency task is required since .NET Core 3.x

  • task: CmdLine@2 inputs: script: 'dotnet tool install --global dotnet-ef'

...

all other the tasks.

But later I found that this is not a proper way of CI. I created CI using YAML but not using classical editor option as mentioned in the guide. And due to that I am having zip files, XMLs and cmd batch files as well in the artifact which should not be.

But for lot of developers the problem starts from .NET Core 3.x onwards!

Showing 31 to 32 of 32 entries