1. 安裝VSCodium或者Code-OSS,OmniSharp報(bào)錯(cuò)
[ERROR] Error: spawn /home/pi/.vscode-server/extensions/ms-vscode.csharp-1.21.10/.omnisharp/1.34.10/run ENOENT
原因是因?yàn)楣俜經(jīng)]有發(fā)布VS Code的ARM版本,所以O(shè)mniSharp暫時(shí)不支持ARM,只支持遠(yuǎn)程調(diào)試(Remote Debugging)
2. dotnet build編譯報(bào)錯(cuò)
error MSB6006: "csc.dll" exited with code 139.?
原因:.NET Core 2.2的ARM版本Bug,微軟官方已經(jīng)不再支持.NET Core 2.2,請(qǐng)使用.NET Core 3.x
3. 安裝EFCore Tool失敗
dotnet tool install --global dotnet-ef
執(zhí)行報(bào)錯(cuò),
The settings file in the tool's NuGet package is invalid: Failed to retrieve tool configuration: Could not find file '/root/.dotnet/tools/.store/dotnet-ef/3.1.2/project.assets.json'.
Tool 'dotnet-ef' failed to install. Contact the tool author for assistance.
暫時(shí)的解決辦法:
dotnet new tool-manifest
dotnet tool install dotnet-ef
然后就可以
dotnet ef migrations add Initial
dotnet ef database update
4. EFCore連接MySQL/MariaDB報(bào)錯(cuò)
Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
MySql.Data.EntityFramework只支持到.NET Core 2.x。
.NET Core 3.x請(qǐng)使用Pomelo.EntityFrameworkCore.MySql。
5. dotnet ef database update報(bào)錯(cuò)
需要先手工創(chuàng)建一下這個(gè)表
CREATE TABLE IF NOT EXISTS `__EFMigrationsHistory` (
? ? `MigrationId` varchar(95) NOT NULL,
? ? `ProductVersion` varchar(32) NOT NULL,
? ? CONSTRAINT `PK___EFMigrationsHistory` PRIMARY KEY (`MigrationId`));
6....