Ubuntu ARM64下的.NET Core 踩坑記錄

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....

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容