Is Visual Basic supported by .NET Core on Linux?
No, there is no Visual Basic support yet. At the very bottom of the roadmap in the "future work" section, it said at one time, that Visual Basic support was set for quarter 3 of 2016, but it is still not released as of March 2017. It is still planned.
Since ASP.NET Core is the most common thing that targets the .NET Core framework, the answer I've provided refers to that.
VB.NET on Linux
There are a few, like SimpleBasic, GnomeBasic and XBasic. None of them are fully compatible with Visual Basic.
The above answer was accepted eons ago, but is horribly outdated, since more recently, there's also .NET Core. This will run the actual VB.NET language, but it will not use Windows Forms controls and features powering most real VB.NET applications. .NET Core 3 does support some variation of Windows Forms, but only on Windows.
Please check Pedro Polonia's excellent answer that contains all the details that mine misses.
.NET Core 2.0 and VB - Is it available on the Mac OS ecosystem?
The .NET Core stack itself is completely cross platform. So you can certainly write Visual Basic (.NET) code and build it using dotnet
on Linux, macOS or Windows.
For example, on my Linux box, I can do:
dotnet new console --language vb
dotnet run
To see a working "Hello World!" application in Visual Basic.
But for a nicer editing experience (with IntelliSense and so on) the open source tool would be VSCode. Unfortunately, it looks like VB Support is still not implemented in VSCode.
How to compile .NET Core app for Linux on a Windows machine
Using dotnet build command, you may specify --runtime
flag
-r|--runtime < RUNTIME_IDENTIFIER >
Target runtime to build for. For a list of Runtime Identifiers (RIDs) you can use, see the RID catalog.
RIDs that represent concrete operating systems usually follow this pattern [os].[version]-[arch]
Fo example, to build a project and its dependencies for Ubuntu 16.04 runtime use:
dotnet build --runtime ubuntu.16.04-x64
Deploy .net core app to linux in visual studio?
Try dotnet-publish-ssh.
It works like dotnet publish, but allows you to copy you app over SSH to your target linux machine.
Here is my config:
dotnet publish-ssh --ssh-host <host> --ssh-user <user> --ssh-password <pass> --ssh-path /var/<myapp> --configuration Release --framework netcoreapp3.1 --runtime linux-x64 --self-contained false /p:PublishSingleFile=true
To restart the app you may try powershell with Posh-SSH module:
Import-Module Posh-SSH
$serverAddress = "host addr"
$user = "user"
$pass = ConvertTo-SecureString "pass" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ($user, $pass)
$launchFolder = "/var/<myapp>"
$sshSession = New-SSHSession -ComputerName $serverAddress -Credential $creds -ErrorAction Stop
Invoke-SSHCommand -SSHSession $sshSession -Command "<your restart command>"
Remove-SSHSession -SSHSession $sshSession
How to run a .NET Core console application on Linux
Follow the below steps to run your application:
Publish your application as a self contained application:
dotnet publish -c release -r ubuntu.16.04-x64 --self-contained
Copy the
publish
folder to the Ubuntu machineOpen the Ubuntu machine terminal (CLI) and go to the project directory
Provide execute permissions:
chmod 777 ./appname
Execute the application
./appname
Related Topics
Dos2Unix: Binary Symbol Found, Skipping Binary File
Setting Environment Variable with Leading Digit in Bash
Dynamic Listening Ports Inside Docker Container
Batch Crop and Resize Images to Create Thumbnails
Building Perf with Babeltrace (For Perf to Ctf Conversion)
Sending Command to Process Using /Proc
How to Give Password in Shell Script
Bash Script Command to Wait Until Docker-Compose Process Has Finished Before Moving On
Upgrading PHPmyadmin (And Other Packages) on Debian Squeeze
Golang Os/Exec, Realtime Memory Usage
How to Send a Mail with a Message in Unix Script
Linux: Move 1 Million Files into Prefix-Based Created Folders
Using Multiple Layers of Quotes in Bash
Read Lines Between Two Keywords