Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dotnet-ef tool is not functioning properly on NetPad on macOS. #78

Open
darwin-z opened this issue Aug 17, 2023 · 9 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@darwin-z
Copy link

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."
image
image
image
image
image

@tareqimbasher
Copy link
Owner

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.

@tareqimbasher
Copy link
Owner

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?

@darwin-z
Copy link
Author

I downloaded NetPad(v0.4.2) from the Release.

image

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

image image

Executing with sudosudo dotnet --info,sudo dotnet-ef

image

Environment variables display as Not Set

image

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

image image

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.

image

@tareqimbasher
Copy link
Owner

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.

@darwin-z
Copy link
Author

darwin-z commented Aug 21, 2023

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

@tareqimbasher
Copy link
Owner

tareqimbasher commented Sep 7, 2023

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.

@tareqimbasher tareqimbasher self-assigned this Sep 7, 2023
@tareqimbasher tareqimbasher added the bug Something isn't working label Sep 7, 2023
@tareqimbasher
Copy link
Owner

tareqimbasher commented Sep 18, 2023

@2hangha1fen9 v0.5.0 is out, can you please verify your issue is resolved.

@darwin-z
Copy link
Author

@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.👍
image

@tareqimbasher
Copy link
Owner

@darwin-z a couple versions of NetPad have been released since the last update here. Are you still experiencing this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants