JetBrains / UnrealLink

Apache License 2.0
128 stars 24 forks source link

Rider does not connect to Unreal #258

Closed CezarMocan closed 1 year ago

CezarMocan commented 1 year ago

Rider version: 2023.1.2 UnrealLink plugin version: 2023.1.0.282 Unreal version: 5.2

The Unreal icon in Rider always shows the Not Connected to Unreal Editor status, even though the Unreal Editor is open. I've tried fresh installs with multiple versions of Rider, and two different versions of Unreal (5.0.2 and 5.2), all on the same project.

When opening the .sln of the Unreal project in Rider for the first time, Rider doesn't ask me to install RiderLink for the Unreal project, so I've been manually adding it to the {Project}/Plugins/Developer/RiderLink. Unreal needs to re-compile the plugin, but it succeeds and the plugin shows up in the Unreal plugins list. If I try to install or extract the plugin in engine or game, from the RiderLink Installation Settings, nothing happens (I click the buttons, but I get no response, and nothing appears in the Rider logs.)

The one possibly relevant snippet of the Rider logs I see is the following, which happens when opening Rider:

--- EXCEPTION #1/2 [InvalidOperationException]
Message = “Sequence contains more than one matching element”
ExceptionPath = Root.InnerException
ClassName = System.InvalidOperationException
Data.ThreadLocalDebugInfo = ScheduleNextSolutionLoadTask
HResult = COR_E_INVALIDOPERATION=80131509
Source = System.Linq
StackTraceString = “
  at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException() in ThrowMoreThanOneMatchException.il:line IL_000A mvid AB96
     at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found) in TryGetSingle.il:line IL_0072 mvid AB96
     at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate) in Single.il:line IL_0000 mvid AB96
     at RiderPlugin.UnrealLink.PluginInstaller.UnrealPluginDetector.<>c__DisplayClass17_0.<.ctor>b__2() in D:\WORK\UnrealLink\src\dotnet\RiderPlugin.UnrealLink\PluginInstaller\UnrealPluginDetector.cs:line 121
     at JetBrains.ProjectModel.Tasks.SolutionLoadTasksSchedulerBase.<>c__DisplayClass21_0.<ExecuteTask>b__1() in SolutionLoadTasksSchedulerBase.il:line IL_0000 mvid 9C09
     at JetBrains.Util.ILoggerEx.Catch(ILogger thіs, Action F, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0075 mvid E750
”

For context, I had an old installation of Rider (maybe one of the 2021 versions) working well with this Unreal project -- it had the Unreal connection icon in the bottom-right, if that helps at all -- but things stopped working as soon as I updated the IDE.

Let me know if you need anything else to help me localize the issue. I love Rider, but it's been real frustrating trying to deal with this issue, running out of things to try.

DecoyRS commented 1 year ago

Hello Can you double check that UnrealLink plugin is enabled in the Rider? Settings > Plugins > Installed

CezarMocan commented 1 year ago

@DecoyRS Yup, it's installed and enabled.

ArtemiyAAA commented 1 year ago

@CezarMocan This exception says that you have more than one uproject file in your project folder. This is true?

CezarMocan commented 1 year ago

Gosh, yes, that's what the more than one matching element was talking about! I had two .uproject files, one was a backup from before I'd turned my project into a C++ one. I removed it and Rider went ahead with installing RiderLink, things working again, thanks a lot!

Assuming the previous Rider / RiderLink / UnrealLink versions I was using when link was working didn't care about multiple .uproject files? Anyway, thanks again for the prompt reply & helping. Feel free to close as resolved.

ArtemiyAAA commented 1 year ago

I am glad to help!

lucastucious commented 10 months ago

Hi there, our workflow need us to have multiple uproject on the same directory, but according to this issue, it prevents us to use UnrealLink... Is there anything we could make to allow UnrealLink ? ?

andreiagmu commented 7 months ago

Today, I had a similar issue where I wasn't able to install RiderLink, so Rider was never able to connect to the Unreal Editor. Turns out I needed to open Rider with Admin privileges, to be able to install RiderLink. This fixed the connection issue for me! :)

https://github.com/JetBrains/UnrealLink/issues/262#issuecomment-1849232203