1
You need to install latest .NET sdk or vs2022
1
Sachin Singh
if i try to install microsoft.entityframeworkcore.tools then it give error
Error NETSDK1045 The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. AgricultureApex C:\Program Files\dotnet\sdk\5.0.415\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 141
1
Make sure microsoft.entityframeworkcore.tools is installed.
1
somehow , i try to add migration and it created
add-migration Register
Build started...
Build succeeded.
Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 6.0.0 initialized 'AgricultureContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.0' with options: None
but nothing created in migration class
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AgricultureApex.Migrations
{
public partial class Register : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
and then if i use command Remove-migration then it give this issue
remove-migration
Build started...
Build succeeded.
Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 6.0.0 initialized 'AgricultureContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.0' with options: None
Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (45ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT 1
Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (34ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT OBJECT_ID(N'[__EFMigrationsHistory]');
Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [MigrationId], [ProductVersion]
FROM [__EFMigrationsHistory]
ORDER BY [MigrationId];
The migration '20221222085450_PhysicalIndicesValueColumn' has already been applied to the database. Revert it and try again. If the migration has been applied to other databases, consider reverting its changes using a new migration instead.
