NetPad
NetPad copied to clipboard
The dotnet-ef tool is not functioning properly on NetPad on macOS.
I've already set up the .NET SDK and installed the dotnet-ef tool. It runs fine in the local command line. However, on the App Dependencies Check page, it shows that the .NET SDK is installed successfully, but dotnet-ef displays "Entity Framework Core .NET tool is not installed."
That's interesting, it looks like although NetPad is saying it can't find the EF Core tool, it was still able to execute it, and then the tool wasn't able to find the .NET SDK.
I assume you restarted NetPad after installing the EF Core tool?
I'll investigate and see what's going on. Thanks for reporting.
Also I noticed in the StackTrace your last screenshot that it seems you've built NetPad from source? If so, were you seeing the same exact error when using the prebuilt binary?
I downloaded NetPad(v0.4.2) from the Release.
So far, I have found that executing it on my local command line with root privileges has the same issue.
Normal state(dotnet --info
,dotnet-ef
)
Executing with sudo
(sudo dotnet --info
,sudo dotnet-ef
)
Environment variables
display asNot Set
However, when I use sudo -E
to preserve the current environment variables, the result is the same as executing directly.
sudo -E dotnet-ef --info
and sudo -E dotnet-ef
I took a rough look at your code, and regarding the operations involving Process.Start
, it seems that user environment variables are not being passed, which might be causing the absence of these variables. Perhaps some modifications are needed here.
Yep that's exactly what the problem is. Thank you for taking the time and digging and providing all that great info, makes my job that much easier! 😄
I think there's a couple more places where I need to pass along the env variables, and the one you pointed to is one of them.
Should have a patch for this soon. Did you use the standard installer from Microsoft to install the .NET SDK or did you use a package manager like homebrew? Trying to account for the different install pathways users might choose.
I use the official dotnet-install.sh installation script to install the .NET SDK, it defaults to installing it in my home directory.
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#script-behavior
Update: #84 is merged and will fix this issue. It will go out in v0.5.0. I also added ~/.dotnet
as a common directory that NetPad will search within for a .NET SDK installation, so you will be able to remove the manual .NET SDK path you set in settings.
Will keep this open until you're able to confirm the new version is working properly for you.
@2hangha1fen9 v0.5.0 is out, can you please verify your issue is resolved.
@2hangha1fen9 v0.5.0 is out, can you please verify your issue is resolved.
It's working now, but the dependency detection dialog is not displaying correctly.👍
@darwin-z a couple versions of NetPad have been released since the last update here. Are you still experiencing this issue?