'Command not found' when running .NET Core console in Ubuntu on Windows Subsystem for Linux - .net-core

I have downloaded .NET Core 3 (preview) and I have in Visual Studio 2019 (preview) created a hello world project consisting of class library and a console program. The program runs on Windows.
I have Windows Subsystem for Linux running Ubuntu 16.04 and I install dot net so that dotnet --info returns something (non error). Are there any other steps required?
If I go to my console apps binary folder and then shift+right mouse button click to get the 'Open Linux shell here' menu item and take that option then my Ubuntu window opens in the same directory as the console app executable.
From the bash prompt if I type the executable name (either with or without.exe) and of the correct casing it just reports 'Command not found'.
I am wondering what step I have missed.

The executable name is not a known command to the shell. You need dotnet <EXECUTABLENAME>

Related

Bash terminal in Visual Studio dotnet not found

I have debian 11 installed in wsl2 on windows 10. I use the dotnet cli tools in visual studio and cmd windows but much prefer the linux syntax. The sdk commands are not exposed to wsl apparently as I get "bash: command dotnet not found" errors. Because WSL is essentially mapping linux commands to windows I don't think I should be installing the dotnet sdk again for linux, but can't really find any confirmation of that. Anyone here doing this who can advise? Just don't want to have to maintain two sets of the dotnet sdk if WSL does not require it.
The sdk commands are not exposed to wsl apparently as I get "bash: command dotnet not found" errors.
That's because WSL does not run Windows executables - it is, after all, a Linux subsystem.
I don't think I should be installing the dotnet sdk again for linux
You have two choices:
Use the Windows subsystem (drop WSL),
install the Linux applications you want to run.

install4j console mode can't choose language to install. Error message " '9' is not recognized as an internal or external command "

We are using install4j to generate a Windows installer for our application.
We would like our users to use the console mode for installations on Windows.
Run command as "xxx.exe -c"
but when I enter number to choose the language,
will get the error " '9' is not recognized as an internal or external command "
So we change install4j configuration to enable the "Windows console executable" option.
enter image description here
and run command "xxx.exe -c" again
Working fine.
And can enter number choose the language to install our application
but we will see the other console windows when I install (that is ok, we don't care)
However, when I double-clicked the xxx.exe to install
we can countinue install our application by GUI mode
but we will see the other console windows when I install
1.
If enable the "Windows console executable",
we can install by console mode and can double-clicked the xxx.exe to install our application with only GUI windows(don't show the console windows)
2.
If disable the "Windows console executable",
we can install by console mode and can enter number to choose language?
A Windows GUI executable cannot attach its input to the console that is was started from. You have to start the installer like this:
start /wait installer.exe -c
Then the installer is put in the foreground.

Jetbains Rider remote debugging ASP.NET Core 6.0 apps through SSH kept failing

I am trying to remote debug via ssh on an ubuntu host at Ali with no success. I'm using the the latest Rider, 2022.1 EAP 10.
The error is:
Debugger worker was not initialized within 100,000 ms
I’m running Ubuntu 20.04 64bit on Ali Cloud. And one side note: for the following steps from Jetbrains documents, I wasn’t able to succeed:
cd /[application path]/WebApplication to go to the application root folder.
chmod +x ./WebApplication to add the executable bit if needed.
ASPNETCORE_URLS=http://0.0.0.0:5000 ./WebApplication to run the application
WebApplication is a directory, the OS kept complaining it's a directory even after chmod+x. I managed to run the self-contained executable.
It is always better to ask such questions in JetBrains public issue tracker.
This problem should already be fixed in the next Rider versions:
https://youtrack.jetbrains.com/issue/RIDER-76083

How do I use Visual Studio 2019 to remotely debug a .NetCore application on a Hyper-V Linux VM?

I am attempting to remotely debug a .NetCore application in Ubuntu Linux from Visual Studio 2019 in Windows 10. I can see the remote ipaddress (ping thru command line). I can RDT to the ipaddress. I can successfully transfer files to it via WinSCP.
I created a simple .NetCore "HelloWorld" app and copied onto the Linux VM.
I used the following commands to build and publish:
dotnet build -r linux-x64
dotnet publish --self-contained -r linux-x64
I ran the following command on the Linux VM to ensure that ssh is functional:
sudo apt-get install openssh-server unzip curl
The app is running on Linux.
From VS I try to attach to the process:
I get prompted for logon:
I get the following error:
Is there a step I'm missing somewhere?
Is there a configuration/permissions issue I am unaware of?
Thanks, JohnB
Microsoft has documented debugging a Linux target from a Windows development machine at https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging-dotnet-core-linux-with-ssh?view=vs-2022
Unfortunately, using that method, you will need to manually deploy and manually attach the debugger. If you'd like Microsoft to change that, then it would be wise to upvote this issue: https://developercommunity.visualstudio.com/t/Convenient-way-to-add-a-remote-debug-con/917516
A 3rd party developer has created a Visual Studio extension that provides this missing feature to Visual Studio. It can be downloaded from https://github.com/radutomy/VSRemoteDebugger
I had the same problem initially because I didn't enter the connection target in the first screen.
After having entered the correct target myusername#192.168.178.95 in the first screen the second screen did not show up any longer and I got the expected list of processes

How to run a kaa file on Windows?

I generated sdk in C ++ by sandbox.
I created the app using the steps described on this page, "http://kaaproject.github.io/kaa/docs/v0.10.0/Programming-guide/Your-first-Kaa-application/".
On Ubuntu I run the kaa-app file with the "./kaa-app" command on the terminal.
Question
How can I run this file on Windows?
Basically you need to compile the whole project on windows - with the windows compiler to be more specific.
Than you will get a windows executable (.exe).

Resources