ErikEJ / EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI
MIT License
2.19k stars 298 forks source link

Unable to install VSIX for ARM64 #2276

Closed itsmekoopa closed 7 months ago

itsmekoopa commented 7 months ago

Hi, I'm running into troubles when trying to install the latest EFCorePowerTools VSIX.

I'm running Visual Studio Professional 2022 (17.9.6) on Windows 11 Parallels on a MacBook Pro 2023 M2 Max (ARM processor).

I downloaded the VSIX from this location: https://marketplace.visualstudio.com/items?itemName=ErikEJ.EFCorePowerTools

After running, it tells me it's no possible to install because there are no supported products. The manifest in the VSIX only shows the VS Community edition as the supported platform. I've edited the manifest file of the package, but after that I ran into other problems.

The exception is as follows:

4/11/2024 4:21:57 PM - Microsoft VSIX Installer
4/11/2024 4:21:57 PM - -------------------------------------------
4/11/2024 4:21:57 PM - vsixinstaller.exe version:
4/11/2024 4:21:57 PM - 17.9.3184+1f4819a97b
4/11/2024 4:21:57 PM - -------------------------------------------
4/11/2024 4:21:57 PM - Command line parameters:
4/11/2024 4:21:57 PM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\xxxxx\Downloads\EF Core Power Tools v2.6.227.vsix
4/11/2024 4:21:57 PM - -------------------------------------------
4/11/2024 4:21:57 PM - Microsoft VSIX Installer
4/11/2024 4:21:57 PM - -------------------------------------------
4/11/2024 4:21:58 PM - Initializing Install...
4/11/2024 4:21:58 PM - Searching for applicable products...
4/11/2024 4:21:59 PM - Found installed product - Visual Studio Professional 2022
4/11/2024 4:21:59 PM - Found installed product - Global Location
4/11/2024 4:21:59 PM - Extension Details...
4/11/2024 4:21:59 PM -  Identifier         : f4c4712c-ceae-4803-8e52-0e2049d5de9f
4/11/2024 4:21:59 PM -  Name               : EF Core Power Tools
4/11/2024 4:21:59 PM -  Author             : ErikEJ
4/11/2024 4:21:59 PM -  Version            : 2.6.227
4/11/2024 4:21:59 PM -  Description        : Useful design-time DbContext features, added to the Visual Studio Solution Explorer context menu.

When right-clicking on a C# project, the following context menu functions are available:
Reverse Engineer - Generates POCO classes, derived DbContext and Code First mapping for an existing database or SQL Server Database project (.dacpac).
Migrations Tool - Manage EF Core Migrations in the project: View status, Add Migration, Update Database
Add DbContext Model Diagram - Adds a DGML graph from your DbContext Model.
View DbContext Model SQL DDL - View a SQL DDL script from your DbContext Model.
About - Displays version and other diagnostic information about your Visual Studio instance. 

4/11/2024 4:21:59 PM -  Locale             : en-US
4/11/2024 4:21:59 PM -  MoreInfoURL        : https://github.com/ErikEJ/EFCorePowerTools/wiki/
4/11/2024 4:21:59 PM -  InstalledByMSI     : False
4/11/2024 4:21:59 PM -  SupportedFrameworkVersionRange : [4.8,)
4/11/2024 4:21:59 PM -  SignatureState     : Unsigned
4/11/2024 4:21:59 PM -  Supported Products : 
4/11/2024 4:21:59 PM -      Microsoft.VisualStudio.Community
4/11/2024 4:21:59 PM -          Version : [17.0,18.0)
4/11/2024 4:21:59 PM -          ProductArchitecture : amd64
4/11/2024 4:21:59 PM -  References         : 
4/11/2024 4:21:59 PM -  Prerequisites      : 
4/11/2024 4:21:59 PM -      -------------------------------------------------------
4/11/2024 4:21:59 PM -      Identifier   : Microsoft.VisualStudio.Component.CoreEditor
4/11/2024 4:21:59 PM -      Name         : Visual Studio core editor
4/11/2024 4:21:59 PM -      Version      : [17.0,)
4/11/2024 4:21:59 PM -      -------------------------------------------------------
4/11/2024 4:21:59 PM -      Identifier   : Microsoft.VisualStudio.Component.GraphDocument
4/11/2024 4:21:59 PM -      Name         : DGML editor
4/11/2024 4:21:59 PM -      Version      : [17.0,)
4/11/2024 4:21:59 PM -      -------------------------------------------------------
4/11/2024 4:21:59 PM -      Identifier   : Microsoft.VisualStudio.Component.VisualStudioData
4/11/2024 4:21:59 PM -      Name         : Data sources and service references
4/11/2024 4:21:59 PM -      Version      : [17.0,)
4/11/2024 4:21:59 PM - Signature Details...
4/11/2024 4:21:59 PM -  Extension is not signed.
4/11/2024 4:21:59 PM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   at VSIXInstaller.ExtensionService.GetInstallableDataImpl(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

An older version of EF Core Power Tools was running, which I uninstalled, because I wanted to upgrade.

What is the way to install the package on non-Community VS?

ErikEJ commented 7 months ago

It is not Community vs other SKUs that is causing issues, it is ARM support that is not present.

Let me investigate if it it possible to bring back support , provided you can beta test for me.

itsmekoopa commented 7 months ago

That would be great! I'd love to beta test. Please let me know what I can do.

ErikEJ commented 7 months ago

When I have a build ready, exercise all the product features (all menu items)

itsmekoopa commented 7 months ago

Sure thing!

I've been using an older build of EF Core Power Tools (EF_Core_Power_Tools_v2.5.537.vsix from March 1, 2021). That version was working on my ARM machine until I updated Visual Studio today.

That's why I uninstalled the old EF CPT build: to try to reinstall the latest build. Uninstall went flawless, installing the new version however... not. ;-)

ErikEJ commented 7 months ago

Got it. I attempted ARM support (someone else did) but it was causing me support headaches.

ErikEJ commented 7 months ago

I implemented a fix for this in the latest daily build, would be grateful if you could try it out.

itsmekoopa commented 7 months ago

Great! Installer is running, but gives the following message:

image

I guess that's due to these pre requisites:

image

Is there a way to install these manually?

ErikEJ commented 7 months ago

I think it is the DGML component, I plan to add that as a pre-req in "EF Core Power Pack" instead.

Try build .132 (where I have removed it)

itsmekoopa commented 7 months ago

You mean this version (.232)? https://www.vsixgallery.com/extension/f4c4712c-ceae-4803-8e52-0e2049d5de9f

Gives me the same error message.

ErikEJ commented 7 months ago

OK, looks like the VisualStudioData component was a mistake, I have tried picking another in the latest build, if that does not work I will try to remove it-.

ErikEJ commented 7 months ago

Build .233 coming up

itsmekoopa commented 7 months ago

Awesome! Version .233 installs and generates the DB models. I've used the 'Reverse engineer' option from context menu.

Want me to try the other options as well? I can do that next Monday.

ErikEJ commented 7 months ago

Can you test reverse engineer with a .dacpac?

And feel free to try the other options, less concerned about them tbh.

ErikEJ commented 7 months ago

@itsmekoopa Thank you som much for help with testing this - last attempt failed since there was not testing follow up.

ErikEJ commented 7 months ago

If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship

itsmekoopa commented 7 months ago

Sure, I'll give it a shot next week. And thank you too, your tools make my daily job a lot easier.

I'll drop you a review and donation!

itsmekoopa commented 7 months ago

Reverse engineering a .dacpac file works. However, a particular error occurs. When generating from an SQL connection, it works.

Probleems seems to be caused by SPs with inner queries, querying a table more than once:

image

Resulting in this error:

Unable to get result set shape for dbo.jam_GetGroepByID
System.ArgumentException: An item with the same key has already been added. Key: rd
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at SqlSharpener.AliasResolutionVisitor.Visit(NamedTableReference namedTableReference) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\SqlSharpener\AliasResolutionVisitor.cs:line 22
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(NamedTableReference node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.NamedTableReference.Accept(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.FromClause.AcceptChildren(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(FromClause node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.FromClause.Accept(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.AcceptChildren(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(QuerySpecification node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.Accept(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.ScalarSubquery.AcceptChildren(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(ScalarSubquery node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.ScalarSubquery.Accept(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.SelectScalarExpression.AcceptChildren(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(SelectScalarExpression node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.SelectScalarExpression.Accept(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.AcceptChildren(TSqlFragmentVisitor visitor)
   at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(QuerySpecification node)
   at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.Accept(TSqlFragmentVisitor visitor)
   at SqlSharpener.Model.Select..ctor(QuerySpecification querySpecification, IDictionary`2 bodyColumnTypes) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\SqlSharpener\Model\Select.cs:line 38
   at SqlSharpener.Model.Procedure.<>c__DisplayClass0_0.<.ctor>b__7(QuerySpecification s) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\SqlSharpener\Model\Procedure.cs:line 54
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at SqlSharpener.Model.Procedure..ctor(TSqlObject tSqlObject) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\SqlSharpener\Model\Procedure.cs:line 54
   at ErikEJ.EntityFrameworkCore.SqlServer.Scaffolding.SqlServerDacpacStoredProcedureModelFactory.GetStoredProcedureResultElements(TSqlProcedure proc) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\Scaffolding\SqlServerDacpacStoredProcedureModelFactory.cs:line 160
   at ErikEJ.EntityFrameworkCore.SqlServer.Scaffolding.SqlServerDacpacStoredProcedureModelFactory.GetStoredProcedures(String dacpacPath, ModuleModelFactoryOptions options, Boolean mergeDacpacs) in C:\Code\Github\EFCorePowerTools\src\Nupkg\ErikEJ.EntityFrameworkCore.SqlServer.Dacpac\Scaffolding\SqlServerDacpacStoredProcedureModelFactory.cs:line 65
ErikEJ commented 7 months ago

Ok, you would get that error anyway due to the shape of your stored procedure. Feel free to open a new issue with repro details if you want me to investigate. And thanks for testing

itsmekoopa commented 7 months ago

Hmm, ok. It seems to work when generating from an SQL connection. Was working in the older version of EF CPT as well. I'll try this out next week, when my project is building + running again. :-)

itsmekoopa commented 7 months ago

Difference between dacpac and SQL connection is that the latter IS generating the model files, while the former doesn't.

ErikEJ commented 7 months ago

Feel free to open an issue with repro details