rider-efcore icon indicating copy to clipboard operation
rider-efcore copied to clipboard

Exception thrown when dotnet not installed or accessible

Open pedro-magueija opened this issue 3 years ago • 4 comments

Describe the bug

The extension is throwing an extension that seems to be related to dotnet not command not being accessible (not installed or not on the path).

Note that, once dotnet is installed the problem no longer occurs, therefore the "impact" is low.

To Reproduce

Steps to reproduce the behavior:

  1. Remove all traces of dotnet (or use a machine that does not have it installed yet)
  2. Install Rider and the extension
  3. Open a project where the extension would be used
  4. Check that the extension throws an exception (excerpt is below)

Expected behavior

The extension should gracefully notify the user that it was unable to find or access the dotnet command.

Environment (please complete the following information):

  • OS: Windows 10 Pro
  • .NET SDK info (installed ones and version used within Rider): No .NET SDK was installed
  • Plugin version: 1.4.0
  • Rider version: 2022.1.2

Additional context

Exception log from Rider:

com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "dotnet": CreateProcess error=2, The system cannot find the file specified at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:362) at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:92) at com.intellij.execution.process.OSProcessHandler.(OSProcessHandler.java:45) at com.intellij.execution.process.CapturingProcessHandler.(CapturingProcessHandler.java:20) at com.intellij.execution.util.ExecUtil.execAndGetOutput(ExecUtil.kt:88) at me.seclerp.rider.plugins.efcore.cli.execution.CliCommand.execute(CliCommand.kt:14) at me.seclerp.rider.plugins.efcore.cli.api.ManagementClient.getEfCoreVersion(ManagementClient.kt:18) at me.seclerp.rider.plugins.efcore.startup.EfCoreStartupActivity.runActivity(EfCoreStartupActivity.kt:30) at com.intellij.ide.startup.impl.StartupManagerImpl.runStartupActivity(StartupManagerImpl.kt:311) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration(StartupManagerImpl.kt:290) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration$default(StartupManagerImpl.kt:285) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1$1.run(StartupManagerImpl.kt:238) at com.intellij.openapi.project.DumbServiceImpl.runWithWaitForSmartModeDisabled(DumbServiceImpl.java:648) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:237) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:62) at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:301) at com.intellij.openapi.extensions.ExtensionPointName.processWithPluginDescriptor(ExtensionPointName.java:143) at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.kt:232) at com.intellij.ide.startup.impl.StartupManagerImpl.access$runPostStartupActivities(StartupManagerImpl.kt:62) at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3$1.run(StartupManagerImpl.kt:180) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:365) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:343) at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3.run(StartupManagerImpl.kt:180) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: java.io.IOException: Cannot run program "dotnet": CreateProcess error=2, The system cannot find the file specified at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:438) at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:352) ... 35 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.base/java.lang.ProcessImpl.create(Native Method) at java.base/java.lang.ProcessImpl.(ProcessImpl.java:487) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) ... 38 more

pedro-magueija avatar Jul 13 '22 06:07 pedro-magueija

Same problem here, claims the following message "EF Core tools are not installed" but it is installed and I can use it via command line

ricardomac avatar Jul 15 '22 20:07 ricardomac

@ricardomac your issue not related to that one.

Please proceed to https://github.com/seclerp/rider-efcore/issues/71, it should be fixed in the next major release.

seclerp avatar Jul 15 '22 22:07 seclerp

@ricardomac your issue not related to that one.

Please proceed to #71, it should be fixed in the next major release.

sorry

ricardomac avatar Jul 15 '22 23:07 ricardomac

This issue will be fixed after implementing #96, thanks for reporting!

seclerp avatar Jul 23 '22 10:07 seclerp