diff --git a/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs b/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs index 94def00bc..8185e4730 100644 --- a/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs +++ b/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs @@ -356,7 +356,8 @@ private async void OnProjectMenuBeforeQueryStatus(object sender, EventArgs e) if (menuCommand.CommandID.ID == PkgCmdIDList.cmdidReverseEngineerCodeFirst || menuCommand.CommandID.ID == PkgCmdIDList.cmdidT4Drop) { - menuCommand.Visible = await project.IsNet60OrHigherAsync() || await project.IsNetStandardAsync(); + menuCommand.Visible = (await project.IsNet60OrHigherAsync() || await project.IsNetStandardAsync()) + && !project.IsMsBuildSqlProjProject(); return; } diff --git a/src/GUI/Shared/Extensions/ProjectExtensions.cs b/src/GUI/Shared/Extensions/ProjectExtensions.cs index d212061ab..6396b8b35 100644 --- a/src/GUI/Shared/Extensions/ProjectExtensions.cs +++ b/src/GUI/Shared/Extensions/ProjectExtensions.cs @@ -165,6 +165,11 @@ public static async Task GetEFCoreVersionHintAsync(this Project project version = new Version(6, 0); } + if (await project.IsNet80Async()) + { + version = new Version(8, 0); + } + return version; } @@ -217,6 +222,13 @@ public static async Task IsNet70OnlyAsync(this Project project) return IsNet70(targetFrameworkMonikers); } + public static async Task IsNet80Async(this Project project) + { + var targetFrameworkMonikers = await GetTargetFrameworkMonikersAsync(project); + + return IsNet80(targetFrameworkMonikers); + } + public static async Task IsNetStandardAsync(this Project project) { var targetFrameworkMonikers = await GetTargetFrameworkMonikersAsync(project); diff --git a/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs b/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs index fa242a0fb..4f8d0fdc8 100644 --- a/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs +++ b/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs @@ -134,6 +134,10 @@ public string DropTemplates(string optionsPath, string projectPath, CodeGenerati { list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore7, Value = "EF Core 7" }); list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore6, Value = "EF Core 6" }); + } + + if (minimumVersion.Major == 8) + { list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore8, Value = "EF Core 8 (preview)" }); }