0. 0Serenity 開發問題紀錄 - lyonwang/TechNotes GitHub Wiki
新增 JS lib 讓 Typescript 可使用
- libMain 載入 js lib 到 wwwroot/Scripts/[jslib_name]/
- 將 ~/Scripts/[jslib_name]/[jslib].js 加入 appsettings.bundles.json
- package.json dependencies 加入 @types/[jslib_name]
- 若有問題就到 Project 裡的 Dependenvies>npm>@types/[jslib_name] Restore 它
VS2019 使用 SERENE Project Template 建立專案的問題處理
- 若移除 Basic sample & Northwind 建議出來的專案會編譯失敗
-
解法
D:\Projects\KMG.Service\Backend\KMGTechSupport.Web\Modules\Common\Dashboard\DashboardPage.cs 加上
using Microsoft.AspNetCore.Mvc;
- 出現錯誤訊息: 提醒註解掉 Migration safety check 程式碼
-
解法
D:\Projects\KMG.Service\Backend\KMGTechSupport.Web\Initialization\DataMigrations.cs 註解掉以下程式碼
// safety check to ensure that we are not modifying an arbitrary database. // remove these lines if you want KMGTechSupport migrations to run on your DB. //if (!isOracle && cs.ConnectionString.IndexOf(typeof(DataMigrations).Namespace + // @"_" + databaseKey + "_v1", StringComparison.OrdinalIgnoreCase) < 0) //{ // SkippedMigrations = true; // return; //}
- 若已存在資料庫,不需要 Migration 功能
-
解法
D:\Projects\KMG.Service\Backend\KMGTechSupport.Web\Initialization\Startup.cs 註解掉以下程式碼
app.ApplicationServices.GetRequiredService<IDataMigrations>().Initialize();
- 【2021-08-06】控制權限一定要在 Page.cs 檔內加以下 Atttribute (Row type)
[PageAuthorize(typeof(Entities.[Row]))]
- 【2021-08-24】 User 新增欄位,要反映在 Authorization.ts,讓 TypeScript 當可以存取
- DB User 新增欄位 > UserRow
- UserDefinition、ScriptUserDefinition 新增要讓 ts 可見的欄位
- UserRetrieveService.GetFirst 新增讀取欄位
- UserDataScript.GetData result 新增讀取欄位
- Visual Studio 在用 Quick Watch Debug ts 時 Authorization.userDefinition 要改成 Q.Authorization.userDefinition 才能看到值