Command-line ASP.NET Core development on Linux
Although command-line is not so popular thing in Windows world it has more love by developers in Linux world. In the light of .NET Core and ASP.NET Core that run also on Linux, developers from Linux world want to know if they can also develop ASP.NET Core applications using simple command-line tools. Here is my overview about how to develop, build and run ASP.NET Core applications on Linux command-line.
Installing client-side tools
It is possible to create ASP.NET Core application right from zero with Visual Studio Code but still the machines were invented to make life easier for human beings. For ASP.NET Core there are yeoman generators available. These generators help developers to generate simple getting-started-type applications.
Although official documentation page Building Projects with Yeoman lists all steps needed to install client-side tools I ran into some troubles on Kubuntu. Here are steps I made to get Yeoman installed and running.
- Run terminal and type if the following command:
sudo apt-get install nodejs
sudo apt-get install npm - If nodejs was installed to /usr/bin/nodejs then we have a problem – most of node commands expect that node can be found from folder /usr/bin/node. The easiest trick to get this problem solved is to run the following command:
sudo ln -s /usr/bin/nodejs /usr/bin/node - Run the following commands:
sudo npm install -g yeoman-doctor
sudo npm install -g yo
sudo npm install -g bower
sudo npm install -g generator-aspnet
Creating default web application with Yeoman
Yeoman is tool to create applications from command line. In case of Visual Studio Code it’s nice to have it creates simple web application that can be used as starting point for some real application. Running Yeoman is simple:
yo aspnet
The following image shows templates that Yeoman offers for ASP.NET Core applications.
From next choices I selected Bootstrap and named my application as BasicTestWeb.
dotnet utility
After application is created it needs some simple care. There is command-line utility called dotnet and it is used to maintain and run .NET Core applications. This utility comes with .NET Core installation and it is installed the way that it can be called from all folders without specifying path.
To restore pckages and build web application the following commands must be run:
- dotnet restore
- dotnet build
- dotnet run
Here’s the screenshot of fragment of output.
If restore and build succeeded and there were no issues on starting web application in Kestrel web server it’s possible to see web application running when opening browser and navigating to http://localhost:5000.
When web application is running then it generates output to console. This way it is easier for developers to see the requests and find out what is going wrong when testing their web applications.
Developing applications on command-line
Yeoman has many more templates available for ASP.NET Core applications:
angularcontroller angularcontrolleras angulardirective angularfactory angularmodule appsettings bowerjson class coffeescript dockerfile gitignore gruntfile gulpfile | htmlpage interface javascript json jsonschemajsx middleware mvccontroller mvcview nuget packagejson program readme startup | stylesheet stylesheetless stylesheetscss taghelper textfile tfignore typescript typescriptconfig typescriptjsx usersecrets webapicontroller |
Syntax to run these generators is actually simple:
yo aspnet:generator-name
Command for adding new controller:
yo aspnet:mvccontroller BlogController
For command-line code editing the most popular tools are perhaps vi/vim and Emacs. Both of these editors can be used to build ASP.NET Core applications on command-line because there are no binary files to worry about. I’m sure Linux gurus have other favorite editors for coding and these should work as well too. Screenshot below shows HomeController.cs open in vim.
Wrapping up
It’s possible to build ASP.NET Core applications fully on command-line. With Yeoman templates it is easy to create simple basis ASP.NET Core applications. Under Linux it is possible to use different code editors that doesn’t need graphical user interface. Of course, managing graphics this way can be challenging. Still writing the code is possible and developers can use the tools they are already familiar with. And there are also good news for those who love open-source: it’s all open-source!
It is the best time to make some plans for the future and it
is time to be happy. I have read this post and
if I could I wish to suggest you few interesting things or advice.
Maybe you could write next articles referring to this article.
I want to read even more things about it! https://wiki.dulovic.tech/index.php/User:LoriFreame810
This is really attention-grabbing, You’re a very skilled blogger.
I’ve joined your feed and look forward to in the hunt for extra of your magnificent post.
Additionally, I’ve shared your site in my social networks
Your mode of telling the whole thing in this piece of writing is really fastidious, all be capable of without difficulty be aware of it, Thanks a lot https://chaussuressemy.com/boutique/
sagte Hartig kopfnickend,エロ 人形nachdenklich das is es,
When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is
added I get four e-mails with the same comment.
Is there any way you can remove people from that service?
Cheers!
Your means of describing all in this post is in fact fastidious, every one be capable of without difficulty understand it, Thanks a lot https://www.departement-ti.com/difference-entre-systeme-informatique-et-systeme-dinformation/
Oh my goodness! Impressive article dude! Thanks, However I am going through
difficulties with your RSS. I don’t understand the reason why I can’t join it.
Is there anybody else having similar RSS problems?
Anyone who knows the answer can you kindly respond? Thanks!!
Your means of telling the whole thing in this paragraph is
truly fastidious, all be able to easily know it, Thanks a lot https://www.transportrbeaudet.ca/fr
Good answer back in return of this difficulty with genuine arguments and explaining the whole thing regarding that.
Hmm is anyone else experiencing problems with the images
on this blog loading? I’m trying to determine if its a
problem on my end or if it’s the blog. Any suggestions would be greatly
appreciated.
id=”firstHeading” class=”firstHeading mw-first-heading”>Search results
Help
English
Tools
Tools
mߋvе to sidebar hide
Actions
General
Here is my blog post; xpay88
Hello there! Quick question that’s totally off topic.
Do you know how to make your site mobile friendly?
My web site looks weird when viewing from my iphone 4. I’m trying to find a template or plugin that might be able to correct this problem.
If you have any suggestions, please share.
Thank you!
Your method of explaining the whole thing in this paragraph is in fact fastidious, every
one be capable of simply be aware of it, Thanks a lot https://plomberiejg.ca/services/plomberie-durgence-longueuil/
Your means of explaining all in this article is really
good, every one can easily know it, Thanks a lot https://www.myozen.ca/reservez/
Your means of describing all in this post is in fact nice, every one be able to simply know it,
Thanks a lot https://chefthierry.ca/pate-de-saumon/
Your method of describing the whole thing in this piece of writing is genuinely fastidious, all can without difficulty understand
it, Thanks a lot https://abrasifsea.com/categorie-produit/meules/meules-a-couper/
It’s amazing to pay a quick visit this website and reading the views of all colleagues concerning this paragraph,
while I am also eager of getting familiarity.
Your means of telling everything in this post is genuinely pleasant, every one be capable of without difficulty
know it, Thanks a lot https://vegtech.ca/en/produit/basculeur-de-caisses-soft-drop/
Your way of describing everything in this piece of writing is in fact good, all be able to without difficulty understand it, Thanks a lot https://www.minientrepotssaintcalixte.ca
Your means of explaining everything in this article
is genuinely fastidious, every one be capable of without difficulty be aware of it, Thanks a lot https://lapimbeche.com/
Your mode of describing the whole thing in this article is really fastidious,
all be capable of simply be aware of it, Thanks a lot https://abrasifsea.com/produit/feuille-ps11/
Your way of telling all in this article is really nice, all can easily understand it, Thanks a lot https://coiffstore.fr/shu-uemura-175
Your way of telling everything in this piece of writing is in fact fastidious, all can easily
understand it, Thanks a lot https://www.coupercroiser.com/service-de-tapis-corporatif-sur-mesure/
Everyone loves what you guys are up too.
Such clever work and exposure! Keep up the fantastic works guys I’ve included you
guys to blogroll.
Good day! I could have sworn I’ve been to
this web site before but after going through a few of the articles I realized it’s new to me.
Anyways, I’m definitely pleased I stumbled upon it and I’ll be
bookmarking it and checking back regularly!
A motivating discussion is worth comment. I do believe that you need to write more
about this subject matter, it may not be a taboo subject but usually people do not talk about these subjects.
To the next! All the best!!
Hello, i think that i saw you visited my blog thus i came
to “return the favor”.I am trying to find things to enhance my site!I suppose its ok to use a few of your
ideas!!
It’s actually a great and helpful piece of information. I’m satisfied that you simply shared this useful information with
us. Please stay us up to date like this. Thank you for sharing.
Informative article, just what I was looking for.
Hi friends, nice post and fastidious arguments
commented here, I am truly enjoying by these.
Every time I visit 여성전용마사지,
I feel like a better version of myself emerges—lighter, more open, and deeply cared for.
Craving mental peace? Let 토닥이 be your escape
to refresh and recentre your thoughts.
When life gets overwhelming, I know I can always find clarity
again at 수원여성전용마사지.
One session of 부산토닥이
cleared my mind completely.
I am actually pleased to read this weblog posts which consists of lots of valuable
information, thanks for providing such information.
I felt so relaxed that I almost fell asleep during the 인천여성전용마사지.
This paragraph will assist the internet people for building
up new blog or even a blog from start to end.
For the reason that the admin of this site
is working, no doubt very quickly it will be well-known, due to its
feature contents.
EPL중계
Hi there! I know this is kinda off topic but I
was wondering if you knew where I could get a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having trouble
finding one? Thanks a lot!
EPL중계
Good post. I’m dealing with some of these issues as well..
EPL중계
Every corner of 수원여성전용마사지 felt intentionally designed to soothe and comfort women like me.
First of all I want to say fantastic blog!
I had a quick question in which I’d like to ask if
you do not mind. I was interested to know how you center yourself and clear your head
prior to writing. I have had difficulty clearing my thoughts
in getting my thoughts out there. I truly do take pleasure
in writing however it just seems like the first 10 to 15 minutes
are generally wasted just trying to figure out how to begin. Any suggestions or tips?
Thank you!
After 여성전용 마사지, I feel like
I pressed pause on life’s chaos.
umsuka
I’m really enjoying the design and layout of your website.
It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more
often. Did you hire out a developer to create your theme?
Excellent work!
Wow that was strange. I just wrote an extremely long comment but after I clicked submit my comment didn’t appear.
Grrrr… well I’m not writing all that over again.
Regardless, just wanted to say superb blog!
When I originally commented I appear to have clicked on the
-Notify me when new comments are added- checkbox and now whenever a comment is added I get 4 emails with the exact same comment.
Perhaps there is an easy method you can remove me from that service?
Kudos!
Pretty great post. I just stumbled upon your weblog and wished to say that I have truly enjoyed browsing your weblog
posts. After all I’ll be subscribing for your feed and I hope you write once more soon!