JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

Rider Inop in 2019.2b6? #1233

Closed jwvanderbeck closed 5 years ago

jwvanderbeck commented 5 years ago

Rider version is latest as installed by Toolbox.

JetBrains Rider 2019.1.2 Build #RD-191.7141.355, built on June 4, 2019

Apologies if this has been reported, but I scanned the first few pages of issues and didn't see it which kind of surprised me.

I installed Unity 2019.2b6 from the Unity Hub, and created a new project from the HDRP template. When I go to Preferences -> External Tools or Preferences -> Rider, the preferences pane is blank and the log is spammed with Rider errors.

Manually loading the project in Rider, which in the past would auto install the Rider plugin also does not seem to do so anymore.

There are a lot of console errors and they dont' stop, so I'm not sure which ones are the right ones to post and which are knock ons.

NullReferenceException: Object reference not set to an instance of an object
Packages.Rider.Editor.EditorPluginInterop.InitEntryPoint () (at <072369e179f6469db1efdb207452957c>:0)
Packages.Rider.Editor.RiderInitializer.Initialize (System.String editorPath) (at <072369e179f6469db1efdb207452957c>:0)
Packages.Rider.Editor.RiderScriptEditor..cctor () (at <072369e179f6469db1efdb207452957c>:0)
Rethrow as TypeInitializationException: The type initializer for 'Packages.Rider.Editor.RiderScriptEditor' threw an exception.
Packages.Rider.Editor.PluginSettings+<>c.<RiderPreferencesItem>b__35_0 (System.String searchContext) (at <072369e179f6469db1efdb207452957c>:0)
UnityEditor.SettingsProvider.OnGUI (System.String searchContext) (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsProvider.cs:103)
UnityEditor.SettingsWindow.DrawControls () (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:322)
UnityEditor.SettingsWindow.DrawSettingsPanel () (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:313)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
van800 commented 5 years ago

Better workaround here: https://github.com/JetBrains/resharper-unity/issues/1233#issuecomment-516761858

Other option is:

van800 commented 5 years ago

For Unity 2019.1.2+ we now do not auto-install EditorPlugin. It is loaded by the package instead directly from Rider installation.

jwvanderbeck commented 5 years ago

As it was a freshly created project, all the packages are expected to be up to date.

I verified this one just now to be sure though and it is indeed up to date.

jwvanderbeck commented 5 years ago

1.10 package from that repo works. Thanks. FYI on it though it still shows as version 1.0.8 in the json.

Arakade commented 5 years ago

Just installed Unity 2019.2.0f1 and am getting this same(?) error (below) on a newly created Unity 2D project. I haven't even tried opening Rider.

When I open the project with Rider (2018.3.4 = latest non-beta from Toolbox AFAIK) it installs the plugin. I then no longer see the errors but am instead told to delete the plugin!

Delete the plugin and the errors come back again!

NullReferenceException: Object reference not set to an instance of an object
Packages.Rider.Editor.EditorPluginInterop.InitEntryPoint () (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/EditorPluginInterop.cs:88)
Packages.Rider.Editor.RiderInitializer.Initialize (System.String editorPath) (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/RiderInitializer.cs:39)
Packages.Rider.Editor.RiderScriptEditor..cctor () (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/RiderScriptEditor.cs:26)
Rethrow as TypeInitializationException: The type initializer for 'Packages.Rider.Editor.RiderScriptEditor' threw an exception.
UnityEditor.CodeEditorProjectSync.PostprocessSyncProject (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditorProjectSync.cs:35)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:154)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

EDIT: I'll try the workaround above re. setting external editor.

EDIT 2: Opening the "External Tools" tab in Preferences causes this error:

NullReferenceException: Object reference not set to an instance of an object
Packages.Rider.Editor.EditorPluginInterop.InitEntryPoint () (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/EditorPluginInterop.cs:88)
Packages.Rider.Editor.RiderInitializer.Initialize (System.String editorPath) (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/RiderInitializer.cs:39)
Packages.Rider.Editor.RiderScriptEditor..cctor () (at Library/PackageCache/com.unity.ide.rider@1.0.8/Rider/Editor/RiderScriptEditor.cs:26)
Rethrow as TypeInitializationException: The type initializer for 'Packages.Rider.Editor.RiderScriptEditor' threw an exception.
Unity.CodeEditor.CodeEditor.<GetFoundScriptEditorPaths>m__0 (Unity.CodeEditor.IExternalCodeEditor codeEditor) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditor.cs:141)
System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].MoveNext () (at <b7efe7e6e548497fac3c4a6049a0a4b6>:0)
Unity.CodeEditor.CodeEditor.GetFoundScriptEditorPaths () (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditor.cs:141)
UnityEditor.PreferencesProvider.ReadPreferences () (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:862)
UnityEditor.PreferencesProvider.OnActivate (System.String searchContext, UnityEngine.UIElements.VisualElement rootElement) (at C:/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesSettingsProviders.cs:195)
UnityEditor.SettingsWindow.ProviderChanged (UnityEditor.SettingsProvider lastSelectedProvider, UnityEditor.SettingsProvider newlySelectedProvider) (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:237)
UnityEditor.SettingsTreeView.SelectionChanged (System.Collections.Generic.IList`1[T] selectedIds) (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsTreeView.cs:66)
UnityEditor.IMGUI.Controls.TreeViewController.NotifyListenersThatSelectionChanged () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:442)
UnityEditor.IMGUI.Controls.TreeViewController.NewSelectionFromUserInteraction (System.Collections.Generic.List`1[T] newSelection, System.Int32 itemID) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:1201)
UnityEditor.IMGUI.Controls.TreeViewController.SelectionClick (UnityEditor.IMGUI.Controls.TreeViewItem itemClicked, System.Boolean keepMultiSelection) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:1190)
UnityEditor.IMGUI.Controls.TreeViewController.HandleUnusedMouseEventsForItem (UnityEngine.Rect rect, UnityEditor.IMGUI.Controls.TreeViewItem item, System.Int32 row) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:348)
UnityEditor.IMGUI.Controls.TreeViewController.DoItemGUI (UnityEditor.IMGUI.Controls.TreeViewItem item, System.Int32 row, System.Single rowWidth, System.Boolean hasFocus) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:507)
UnityEditor.IMGUI.Controls.TreeViewController.IterateVisibleItems (System.Int32 firstRow, System.Int32 numVisibleRows, System.Single rowWidth, System.Boolean hasFocus) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:691)
UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:594)
UnityEditor.IMGUI.Controls.TreeView.OnGUI (UnityEngine.Rect rect) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewControl/TreeViewControl.cs:414)
UnityEditor.SettingsWindow.DrawTreeView () (at C:/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:349)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/IEventDispatchingStrategy.cs:64)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/MouseEventDispatchingStrategy.cs:59)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Also get this from most other menu items ("General", "2D", (not "Cache Server!?"), "Colors", "Diagnostics", "GI Cache"). The "Rider" tab throws a whole load of other errors. Having seen Joachim using Rider, I'd really assume this would have been tested so... What am I missing?

van800 commented 5 years ago

2018.3.4 is far not the last release on toolbox. Package 1.1.0 is very close to being published. It is a shame that Unity released 2019.2 without it. I did many PRs to the package, but releasing the package is up to Unity team.

Arakade commented 5 years ago

2018.3.4 is far not the last release on toolbox.

Um, are you saying 2018.3.4 isn't the latest non-beta version?

Rider-2018-3-4

EDIT: Oh nooo... I just found another entry waaaaay at the bottom of my huge list of packages! Now I'm really annoyed. I bought Rider all packages and my thanks seems to be having had updates hidden from me after a previous beta put me off due to not doing the Unity debugger stuff I use! Grrr. Updating :(

Rider-others

Ennaxor commented 5 years ago

Hey! I updated Rider to the 2018.3.5 version but it still doesn't work! Did you solve the issue?

van800 commented 5 years ago

@Ennaxor Please use 2019.1.3 release or 2019.2 EAP.

Ennaxor commented 5 years ago

@van800 Updated Rider to 2019.1.3 and still not working.

image

van800 commented 5 years ago

@Ennaxor switch the external script editor in Unity.

van800 commented 5 years ago
  1. Open Packages\manifest.json and change "com.unity.ide.rider": "1.0.8" into "com.unity.ide.rider": "1.0.2".
  2. Set Rider 2019.1.3 as External Editor
  3. Change manifest.json back.
Ennaxor commented 5 years ago

Thanks a lot @van800 :D That fixed it!

Arakade commented 5 years ago

ditto. Thx

SiggiG commented 5 years ago

Thanks that worked! :)

van800 commented 5 years ago

Package v.1.1.0 is available. Solves the issue completely. image

marnel-estrada commented 5 years ago

Is it just me? I don't see 1.1.0 version in my Package Manager. We're using Unity 2019.2.

van800 commented 5 years ago

@marnel-estrada Try to press "see all versions"? I tried even with new project 1.1.0 is still there.

marnel-estrada commented 5 years ago

Still can't see it. image

van800 commented 5 years ago

@marnel-estrada I can check on your OS and Unity version, please share those. Is it consistent on new empty project? You may also share manifest.json.

marnel-estrada commented 5 years ago

OS: Windows 10 Unity: 2019.2.0f1

Here's my manifest.json: manifest.zip

jwvanderbeck commented 5 years ago

What happens if you just update your manifest by hand to point to 1.1.0?

On Tue, Aug 13, 2019 at 8:49 AM marnel-estrada notifications@github.com wrote:

OS: Windows 10 Unity: 2019.2.0f1

Here's my manifest.json: manifest.zip https://github.com/JetBrains/resharper-unity/files/3497779/manifest.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JetBrains/resharper-unity/issues/1233?email_source=notifications&email_token=AABHKZXZ5Y6FQWBG74JNKHDQELJXTA5CNFSM4H2KRQZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4GDB5I#issuecomment-520892661, or mute the thread https://github.com/notifications/unsubscribe-auth/AABHKZRVB42HPLCWKY6UCHTQELJXTANCNFSM4H2KRQZA .

van800 commented 5 years ago

You are using staging packages gallery.

van800 commented 5 years ago

For some reason, when packages.json targets staging gallery "registry": "https://staging-packages.unity.com", package manager in Unity doesn’t show Rider package v.1.1.0 https://download.staging-packages.unity.com/com.unity.ide.rider/-/ doesn’t contain 1.1.0 But this old forum answer says that it should work fine. https://forum.unity.com/threads/how-to-use-both-packages-and-staging-packages.534115/

I have raised the issue to Unity team.

van800 commented 5 years ago

I have got a comment from Unity team that staging gallery is deprecated and is going to be completely removed.

marnel-estrada commented 5 years ago

What should I use then? "https://packages.unity.com"?

marnel-estrada commented 5 years ago

What happens if you just update your manifest by hand to point to 1.1.0?

It says this: image

marnel-estrada commented 5 years ago

Thanks for the help. I used "https://packages.unity.com" and it works now.

van800 commented 5 years ago

Removing the line should be better.

On Wed, Aug 14, 2019, 17:20 marnel-estrada <notifications@github.com wrote:

Thanks for the help. I used "https://packages.unity.com" and it works now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JetBrains/resharper-unity/issues/1233?email_source=notifications&email_token=AALJ7OMISM4YU62KTUXHCULQEQPCRA5CNFSM4H2KRQZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4JESNY#issuecomment-521292087, or mute the thread https://github.com/notifications/unsubscribe-auth/AALJ7OJJVHOOIYNTP5ENEBLQEQPCRANCNFSM4H2KRQZA .