GlitchEnzo / NuGetForUnity

A NuGet Package Manager for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to find DOTNET path when trying to pack a new package

javier-calet-mc opened this issue · comments

Description

When trying to create a new package, and when pressing the PACK button in the Nuspec Editor, the process fails as it cannot resolve the Bash std output of the "which dotnet" process.

First there is the next warning with stacktrace:

Failed to get path of command dotnet using 'which' command -> using 'dotnet' as a command path instead. Error: System.InvalidOperationException: The Process object must have the UseShellExecute property set to false in order to redirect IO streams.
at System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) [0x00060] in <620b3c283008451faac1acc2fa757548>:0
at System.Diagnostics.Process.Start () [0x00032] in <620b3c283008451faac1acc2fa757548>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x0001b] in <620b3c283008451faac1acc2fa757548>:0
at NugetForUnity.Helper.NugetCliHelper.GetDotnetExecutablePath (System.Text.Encoding outputEncoding) [0x00026] in ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:184
UnityEngine.Debug:LogWarningFormat (string,object[])
NugetForUnity.Helper.NugetCliHelper:GetDotnetExecutablePath (System.Text.Encoding) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:203)
NugetForUnity.Helper.NugetCliHelper:CreateStartInfoForDotNetExecutable (string,string) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:104)
NugetForUnity.Helper.NugetCliHelper:RunNugetProcess (string,bool) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:150)
NugetForUnity.Helper.NugetCliHelper:Pack (string) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:38)
NugetForUnity.Ui.NuspecEditor:OnGUI () (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Ui/NuspecEditor.cs:275)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

Then fails with exception:

Win32Exception: ApplicationName='dotnet', CommandLine=' /Users/caletbak/Public/Code/Nuget/Packages/NuGet.CommandLine.6.8.0/tools/NuGet.exe pack "/Users/caletbak/Public/Code/Nuget/Assets/DependencyInjection.nuspec" -OutputDirectory "/Users/caletbak/.local/share/NuGet/Cache" -NoDefaultExcludes', CurrentDirectory='', Native error= Cannot find the specified file
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <620b3c283008451faac1acc2fa757548>:0)
System.Diagnostics.Process.Start () (at <620b3c283008451faac1acc2fa757548>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) (at <620b3c283008451faac1acc2fa757548>:0)
NugetForUnity.Helper.NugetCliHelper.RunNugetProcess (System.String arguments, System.Boolean logOutput) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:155)
NugetForUnity.Helper.NugetCliHelper.Pack (System.String nuspecFilePath) (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Helper/NugetCliHelper.cs:38)
NugetForUnity.Ui.NuspecEditor.OnGUI () (at ./Library/PackageCache/com.github-glitchenzo.nugetforunity@17c6330d51/Editor/Ui/NuspecEditor.cs:275)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at /Users/bokken/build/output/unity/unity/Editor/Mono/HostView.cs:512)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/DockArea.cs:385)
UnityEditor.DockArea.OldOnGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/DockArea.cs:376)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:376)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:676)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:648)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:641)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:601)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:590)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:514)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:267)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:189)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:173)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/MouseCaptureDispatchingStrategy.cs:88)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:422)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:363)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:321)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:285)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:77)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:413)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:229)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Panel.cs:457)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:477)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:205)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

  • NuGet Package: [What is the name and version of the NuGet package you are installing?]

Not installing, it is when trying to pack a new created package following NuGetForUnity package documentation for creating packages.

  • NuGetForUnity Version: [What version of NuGetForUnity are you running?]

Installed from GIT Repo, version 4.0.2.

  • Unity Version: [What version of Unity are you using?]

2022.3.13f1

  • Operating System: [What OS are you on?]

MacOS Sonoma 14.1.1

I hope my PR fixes this, but probably the error comes from not installing dotnet / mono on the Mac. I don't know if the dotnet runtime (CLI) installed with Unity can be found with 'witch' on a mac. Eventually you need to install the dotnet CLI separately.