How to run C# code on Ubuntu

0 votes
How can I run C# code on Ubuntu? Can I install Visual Studio for Ubuntu? I have a Ubuntu machine and I want to work on C# applications. Please suggest.
Mar 1 in Others by Abha
• 5,480 points
35 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hey @Abha, you can create and run C# applications on Ubuntu. For that, you just have to install Visual Studio for Ubuntu. Please follow the mentioned steps one by one and you will be able to install it without any hassle:

1. Use the following command to install Microsoft key:

>>curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

 

>>sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

2. Then use next line of code to install the repository with following script:

>>sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

3. Now update the Package repository and install Visual Studio Code:

>>sudo apt-get update
>>sudo apt-get install code # or code-insiders

4. After successful installation of Visual Studio Code, open 'Visual Studio Code IDE' on your system and navigate to 'Extensions'. Now search for 'C# Extensions' and click 'Install' to install it:

5. Finally install .NET SDK using following command and you are good to go. You can now create and run your C# code in ubuntu:

>>sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

answered Mar 1 by Anvi
• 5,680 points

Related Questions In Others

0 votes
1 answer

How to check if array is multidimensional or not?

Since the 'second dimension' could be just ...READ MORE

answered Nov 5, 2018 in Others by DataKing99
• 8,100 points
64 views
0 votes
1 answer

How is machine learning used to detect objects?

To understand the surrounding environment in real ...READ MORE

answered Nov 30, 2018 in Others by Kailash
34 views
0 votes
0 answers

How to communicate gRPC example working with Node.js?

Hi Guys, I am working as a Node.js ...READ MORE

Dec 5, 2018 in Others by camillelola
• 140 points
141 views
0 votes
1 answer

How to get the URL of the current tab in Google Chrome?

There are different ways of doing this:- You ...READ MORE

answered Dec 21, 2018 in Others by Nabarupa
50 views
0 votes
1 answer
0 votes
1 answer

How to install C#

Hi @Akanksha, C# is a programming language ...READ MORE

answered Feb 28 in Others by Pratibha
• 2,520 points
21 views
0 votes
1 answer

Install postgreSQL on Ubuntu

Installing PostgreSQL on Ubuntu is very simple, ...READ MORE

answered Mar 22 in Database by Nitesh
14 views
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,170 points
47 views
0 votes
1 answer

How to do Installation of Ruby on Rails on Linux (Ubuntu)?

Hi Pratibha, installing ROR on ubuntu is ...READ MORE

answered Mar 1 in Others by Anvi
• 5,680 points
21 views
0 votes
1 answer

Golang on Linux... How to install it?

Hey @Abhi, if you want to install ...READ MORE

answered Mar 1 in Others by Anvi
• 5,680 points
32 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.