JetBrains / rider-efcore

Entity Framework Core UI plugin for JetBrains Rider
https://plugins.jetbrains.com/plugin/18147-entity-framework-core-ui
MIT License
180 stars 14 forks source link

Entity Framework Core menu item is greyed out #171

Closed AlizerUncaged closed 1 year ago

AlizerUncaged commented 1 year ago

Describe the bug

i can't select use the entity framework core UI because it's greyed out

To Reproduce

Steps to reproduce the behavior:

  1. right click a project from the solution
  2. click Tools in the menu

Expected behavior

ef core ui menu item is clickable

Screenshots

image

Environment (please complete the following information):

seclerp commented 1 year ago

Hi @AlizerUncaged

Does the project on which you invoke the context menu is EF Core related? Is it a startup project with Microsoft.EntityFrameworkCore.Tools/Design NuGet or compatible migrations project? Please revisit the requirements.

It would be great if you provide repro solution.

kibao commented 1 year ago

Got same problem.

It's caused by exception:

AddMigrationAction#update@ProjectViewPopup (me.seclerp.rider.plugins.efcore.features.migrations.add.AddMigrationAction), actionId=EfCore.Features.Migrations.AddMigrationAction, text='Add Migration'

   java.lang.NoClassDefFoundError: com/intellij/workspaceModel/ide/WorkspaceModel
    at me.seclerp.rider.plugins.efcore.features.shared.AnActionEventExKt.getFileProject(AnActionEventEx.kt:50)
Click for full stacktrace ``` AddMigrationAction#update@ProjectViewPopup (me.seclerp.rider.plugins.efcore.features.migrations.add.AddMigrationAction), actionId=EfCore.Features.Migrations.AddMigrationAction, text='Add Migration' java.lang.NoClassDefFoundError: com/intellij/workspaceModel/ide/WorkspaceModel at me.seclerp.rider.plugins.efcore.features.shared.AnActionEventExKt.getFileProject(AnActionEventEx.kt:50) at me.seclerp.rider.plugins.efcore.features.shared.AnActionEventExKt.isEfCoreActionContext(AnActionEventEx.kt:35) at me.seclerp.rider.plugins.efcore.features.shared.BaseCommandAction.update(BaseCommandAction.kt:32) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:159) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:182) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:740) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$4(ActionUpdater.java:145) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$computeOnEdt$7(ActionUpdater.java:240) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$computeOnEdt$8(ActionUpdater.java:231) at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.computeWithSpan(trace.kt:171) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$computeOnEdt$9(ActionUpdater.java:229) at io.opentelemetry.context.Context.lambda$wrapSupplier$8(Context.java:309) at com.intellij.openapi.actionSystem.impl.ActionUpdateEdtExecutor.lambda$computeOnEdt$0(ActionUpdateEdtExecutor.java:47) at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:193) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:789) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:759) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589) at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at com.intellij.openapi.actionSystem.impl.Utils.lambda$expandActionGroupImpl$3(Utils.java:260) at com.intellij.openapi.actionSystem.impl.Utils.runLoopAndWaitForFuture(Utils.java:869) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroupImpl(Utils.java:258) at com.intellij.openapi.actionSystem.impl.Utils.lambda$fillMenu$6(Utils.java:349) at com.intellij.openapi.actionSystem.impl.Utils.computeWithRetries(Utils.java:898) at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:348) at com.intellij.openapi.actionSystem.impl.ActionMenu.fillMenu(ActionMenu.java:445) at com.intellij.openapi.actionSystem.impl.ActionMenu.setPopupMenuVisible(ActionMenu.java:390) at java.desktop/javax.swing.JPopupMenu.menuSelectionChanged(JPopupMenu.java:1509) at java.desktop/javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:134) at java.desktop/javax.swing.plaf.basic.BasicMenuUI.appendPath(BasicMenuUI.java:264) at java.desktop/javax.swing.plaf.basic.BasicMenuUI$Actions.actionPerformed(BasicMenuUI.java:322) at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311) at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:789) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:759) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589) at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) Caused by: java.lang.ClassNotFoundException: com.intellij.workspaceModel.ide.WorkspaceModel PluginClassLoader(plugin=PluginDescriptor(name=Entity Framework Core UI, id=me.seclerp.rider.plugins.efcore, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-3/232.8453.124/Rider EAP.app.plugins/riderefcore, version=232.0.0-eap02, package=null, isBundled=false), packagePrefix=null, state=active) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:156) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 94 more ```

It looks like it bug was fixed in 2de442b73f3f6b5abbc5d6900a8b7ff0403242a3, but was not released.

Code at tag v232.0.0-eap02: https://github.com/JetBrains/rider-efcore/blob/7981add9355bc0ffd3a07d1ab81a9882692bc95f/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/shared/AnActionEventEx.kt#L8

Code at current branch release/232 https://github.com/JetBrains/rider-efcore/blob/26e077b9e797f6627a246fba0340761d26bfce98/src/rider/main/kotlin/com/jetbrains/rider/plugins/efcore/features/shared/AnActionEventEx.kt#L8

Environment

Project Details

seclerp commented 1 year ago

Thanks for the investigation!

Seems like a plugin's build for previous EAPs is not valid anymore because of package restructuring. Will release a fix in a few days.

seclerp commented 1 year ago

https://plugins.jetbrains.com/plugin/18147-entity-framework-core-ui/versions/stable/359321