天天看點

ABP 01 項目的基本運作

記錄一下我出現的問題,大多是沒有仔細看文章。

1、無法遷移資料庫,錯誤如下:

  Your startup project 'MyABP.Core' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.    

ABP 01 項目的基本運作

   解決:設定 EntityFrameworkCore 為啟動項目,然後再遷移。

  

ABP 01 項目的基本運作

2、運作項目後,打開user清單報錯,錯誤如下:

  SqlException: Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement.

  我資料庫是SQL Server 2008

ABP 01 項目的基本運作

  解決:

    語句位置:MyABP.EntityFrameworkCore.MyABPDbContextConfigurer 的 Configure 方法

    将  builder.UseSqlServer(connectionString);  修改為  builder.UseSqlServer(connectionString, b => b.UseRowNumberForPaging());

ABP 01 項目的基本運作