Is Visual Basic Supported by .Net Core on Linux

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:

  1. Publish your application as a self contained application:

    dotnet publish -c release -r ubuntu.16.04-x64 --self-contained
  2. Copy the publish folder to the Ubuntu machine

  3. Open the Ubuntu machine terminal (CLI) and go to the project directory

  4. Provide execute permissions:

    chmod 777 ./appname
  5. Execute the application

    ./appname


Related Topics



Leave a reply



Submit