I've been testing dotnet core 3 in different OS like Windows and Linux(Ubuntu). All of them are working fine with EF Core!
However, I decided to give a chance to Windows WSL - Windows Subsystem for Linux and see how it works. That's why I'm here!
The problem with WSL and Ubuntu 18.04 is:
I installed EF Core globally and restarted the terminal. * Up to this point, the EF version is 3.1.4
> dotnet tool install --global dotnet-ef
I get the following error when I try to run any dotnet ef command:
> dotnet ef database update
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Has anyone faced the same error using Windows WSL and Ubuntu 18.04?
Finally I found the solution!
I've tried to export the PATH variable export PATH="$PATH:$HOME/.dotnet/tools" as #kapsiR mentioned. However, it was valid for a single terminal session only. So if I close the terminal and open again, the $PATH configuration disappears.
The solution that works for me:
cd /home/yourUserName
Edit the file .zshrc and add this line export PATH="$PATH:$HOME/.dotnet/tools/". NOTE: I'm using zsh shell in this case. You should change it if you are using a different one.
Restart your terminal
Sadly, the PATH isn't exported directly after the installation of the dotnet-sdk.
You basically have two options:
Add the tool path manually for the current session:
export PATH="$PATH:$HOME/.dotnet/tools"
OR
Start a new session of the WSL
With the dotnet-sdk there comes a script which adds it to the PATH, it's located under /etc/profile.d/dotnet-cli-tools-bin-path.sh.
Related
My environment:
Ubuntu 20.04.3 LTS on Windows 10
-> https://www.microsoft.com/store/productId/9NBLGGH4MSV6
PhpStorm 2022.1 Build #PS-221.5080.224, built on April 13, 2022
My Problem:
I'm trying to export a PostgreSQL database inside the Database tab of PhpStorm.
To execute the export I right click the database in the list and click on the "Export with 'pg_dump'" option. This opens the Export window with all the options and command preview:
Inside of the window I get the error message "Path to executable is wrong" even tho the pg_dump file exists at the given path /usr/bin/pg_dump. This stops me from executing the export.
I have tried to manually install pg_dump in another directory and select it in the PhpStorm Export window, but it still won't detect the executable. The executable itself works fine.
The solution to this problem was to do a sudo apt-get install postgresql-client.
Apparently there is a general problem with the pg_dump executable of the "postgresql-client-common" package:
https://askubuntu.com/questions/501091/command-pg-dump-not-found
After installing the postgresql-client package, everything works fine in PhpStorm as well.
The code is pretty simple there: IDE checks that file exists and is executable, then run /path/to/pg_dump --version command and parse output looking for some keywords. Unfortunately there are no logs which can show exact reason, but I guess the issue that IDE can't get access to the file. Most likely due to WSL. The workaround is to install IDE and unpack PG binaries on Windows, then configure port forwarding to make PG server accessible from host OS.
I am trying to install Emscripten on my computer, and I have run into trouble getting Emscripten actually installed.
I am using the same commands as can be found on the project webpage, but when I try to run
emsdk install latest
Powershell (which is what I am using, but the basic command prompt is behaving the same way) doesn't do anything at all - it just returns without installing anything.
For reference, I have installed Emscripten on this same computer before, but decided to try and do a fresh install of Emscripten after running emsdk activate latest decided to "stop working" as well (whereas it worked just fine last week) - running the command, Powershell simply returned without actually doing anything.
Any ideas on what to check to see why these commands don't seem to run?
I think I solved it. When running the install command in Powershell ISE, it threw the error "Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640"
despite me having Python installed. Changing the order of my PATH variables to set my Python install directory above the Winapps directory solved the issue with running the install command.
I have tried to install ionic on Windows but installation has failed. What should I do?
I have tried more than 20 times but still I got the same problem.
Here I have attached the screenshot for this
Entered commands:
npm install -g cordova
npm install -g ionic
Note: this one windows server machine
My guess is that the NPM global path has not been added to your windows path.
These are the steps to try:
First verify that the command just installed can run. The output contains the full path to the command installed, just copy and paste it to the command line. In your case it might be something like this %APPDATA%\Roaming\npm\iconic -v
Lets assume that works. That means that the command was successfully installed and will run, now we need to add it to your PATH so you can run it from the command line.
Next, Press Windows key and type "path" and select "Edit environment variables for your account". From here. Add or append the path %APPDATA%\Roaming\npm to your PATH variable, and save the results.
Once it is on your PATH you can run it from any command shell window.
Next, start a new command shell (e.g., Windows+R, cmd, Enter) and then type the command iconic -v. Viola, it should work without requiring the full path to the script.
I'm doing most of this from memory so hopefully it's correct. But if it needs some tweeks, let me know and I'll update the answer.
For completness, this install didn't actually fail. The lines with fsevents are warnings. The fsevents package is only designed to work on Mac Unix so these warnings can be safely ignored.
As Suraj Rao mentioned, also see Nodejs cannot find installed module on Windows?.
Is there any way to create (from scratch) and run simple C# Console app in VSCode editor. ?
Can you please provide step-by-step instruction how I can do that?
What kind of files I must to include (except HelloWolrd.cs obviously)?
What kind of commands I must to execute?
Navigate to the folder you want to create the console app in. In VSCode, use Ctrl+` to open the terminal window or go to View and select Integrated Terminal. Now type the following below:
dotnet new console
dotnet restore
dotnet run
The best way at this present time to create a console application is to create a DNX style Console Application.
I would advise that you download and install the generator-aspnet Yeoman generator and use that to generate a DNX Console application. Once you've got generator-aspnet installed, in your terminal/console app type yo aspnet and select Console Application.
Here's a thorough guide to creating a DNX Console application which will work with VS Code: http://docs.asp.net/en/latest/dnx/console.html
I was trying to get a 'hello world' set up using visual studio code and c# on mac/osx.
the way I did it was as follows:
Install VS Code and the C# extension
Here (https://www.microsoft.com/net/core#macos) are instructions for installing dotnet core using brew:
Install OpenSSL
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Install dotnet core pkg: https://go.microsoft.com/fwlink/?LinkID=827526
Create a folder somewhere and in that folder run dotnet new
Go into VS code and open the folder to get the project loaded
Open the terminal in that folder and run dotnet run
To create run as a task
CMD+shift+P then type task
select the Task: Configure Task Runner option
in the tasks.json file after the build task, add the following:
{
"taskName":"run",
"args": [
"${workspaceRoot}/project.json"
]
}
I am having trouble running mono CLI commands inside the msysgit console. It works fine in the windows command prompt added by the Mono installer. I have paid attention to the path env variable in the mono command prompt and added C:\Program Files (x86)\Mono\bin\; to the beginning of my system path (and restarted msysgit).
I am getting the following error when trying to run xbuild:
/c/Program Files (x86)/Mono/bin/xbuild: line 2: cygpath: command not found Cannot open assembly 'xbuild.exe': No such file or directory.
What am I missing from msysgit to help mono's CLI tools work better?
Mono for windows is built with cygwin + mingw (see Mono compile guide).
I'm not sure whether it's fully compatible with msys or not. From the error, I guess there is a problem of path. You may need cygpath.exe in your path from the following link. You should probably invoke mono either from Cygwin or cmd (through the bat provided files).
Even if mono for windows is compiled with mingw (and thus should not depend on cygwin), from your error, we can see there are still cygwin dependencies.