Saturday, May 21, 2016

.Net Core - Hello World from command line

.Net Core is now RC2 and is hopefully going to be stable and not see major changes. Some very basic developmental structural changes happened across RC1 and RC2 so this is never guaranteed though. RC2 has much cleaner and consistent (with other programming languages) development experience which usually is something like following.

  1. Download and install the language
  2. Create a program
  3. Compile and run it
You can follow these steps below to get up and running with your first .Net core Hello World project.
  1. Download and install .Net core from https://www.microsoft.com/net/core#windows
  2. Open command prompt and create a new directory and 'cd' to that directory
    • mkdir newproject
    • cd newproject
  3. Create a new .Net core project in the 'newproject' directory that we created above.
    • dotnet new
  4. Restore all the dependencies for the project
    • dotnet restore
  5. Compile and run
    • dotnet run
That is all. You have your first .Net Core Hello World! program up and running.

I have created a chocolatey pacage so that .Net core SDK can be installed from command like itself. This package is located here.

With chocolatey, the steps then become as follows.

  1. Install .Net core. Note the -pre that is required because it is a prelease version of .net core. It will install latest .Net core which is RC2 as of this post. This installs .net core and updates the PATH so that 'dotnet' command is available from the command prompt.
    • choco install dotnetcoresdk -pre -y
  2. Refresh PATH for current command prompt session. Chocolatey comes up with pretty neat command for this.
    • refreshenv
  3. Create a new project directory and go to that directory
    • mkdir newproject
    • cd newproject
  4. Create new project
    • dotnet new
  5. Restore all the dependencies for the project
    • dotnet restore
  6. Compile and run
    • dotnet run
That's it. You have a.net core application running while never had to leave the command prompt.

22 comments:

isabella said...

Good admin.keep it up.your blog was informative. Thank you for sharing.The Millionaire Guide On Hadoop Training in Chennai To Help You Get Rich.Learn more details....
Android Training in Chennai
Dot Net Training in Chennai

sanjay said...

Nice Blog.Thank you for Sharing. Wonderful post...Embedded Training Institute in Chennai | Embedded Training Institute in VElachery

Devi said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge...Diploma Project Center in Chennai | Diploma Project Center in Velachery

Unknown said...

I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
web design training in chennai

Unknown said...

Those rules moreover attempted to wind up plainly a decent approach to perceive that other individuals online have the indistinguishable enthusiasm like mine to get a handle on incredible arrangement more around this condition
Dotnet Training in Marathahalli

Unknown said...

Great Article.. Very interesting blog which helps me to get the in-depth knowledge about the technology. Thanks for sharing such a great blog..Software Testing Training Institute in Chennai | Selenium Training Institute in Chennai | ISTQB Training Institute in Chennai

Unknown said...

Interesting post! This is really helpful for me. I like it! Thanks for sharing!
Mobile application developers in Chennai | PHP developers Chennai

Mani said...

Your blog is really interested.Please keep sharing.

Hadoop online Training \ Informatica Online Training \ ETL Testing Online Training

Mani said...

Tutorial is very great.your sharing content is very interested.Thanks to sharing.keep it.

UNIX Shell scripting training in chennai \ ORACLE apps finance training in chennai

Unknown said...

Thanks for sharing this niche useful informative post to our knowledge.
brochure designers in chennai | brochure design company in chennai

evergreensumi said...

I just needed to record a speedy word to express profound gratitude to you for those magnificent tips and clues you are appearing on this site.
fire safety manager course in chennai

Unknown said...

Great Blog... The information you shared is very effective for learners I have got some important suggestions from it, Keep Sharing such a nice blog.
BluePrism Training Institute in Chennai | UIPath Training Institute in Chennai | Automation Anywhere Training Institute in Chennai

Unknown said...

This blog very nice and informative. Thanks for sharing this blog. waiting for your next articles...
No.1 Microsoft Azure Training Institute in Chennai | No.1 Microsoft Azure Training Institute in Velachery

rajendran said...

Keep doing awesome! I have bookmarked it and I am anticipating perusing new articles.
Certified Ethical Hacking Training in Chennai | Blue Prism Training Institute in Chennai

ancy said...

The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
Cloud Computing Training Institute in Chennai | Cloud Computing Training Institute in Velachery

Babyma said...

Interesting post! This is really helpful for me. I like it! Thanks for sharing!
Best RPA Training Institute in Chennai | Best RPA Training Institute in Velachery

Saranya said...

This blog very nice and informative. Thanks for sharing this blog. waiting for your next articles...
Blue Prism Automation Robotic course in Chennai | Blue Prism Automation Robotic course in Velachery

Anonymous said...

Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
web designer course in chennai
web design development training in chennai
web designing course with placement in chennai
web design and programming courses in chennai
web design and development training in chennai
web designing courses in chennai
web designing training and placement in chennai
mobile application development course
mobile app development training
mobile application development training online
web designing course with placement in chennai
web designing training institute in chennai
web design and development training
Web Designing Course Training Institute in Chennai

divi said...


thanks for your details it's very used for my works web design company in velachery

maurya said...

Fantastic blog found to be very exciting to come across such an excellent blog. Keep sharing blogs.
selenium automation jobs
data science future
common grammar mistakes in english
common grammatical errors in english
node js advanced interview questions
pega testing interview questions

Durai Raj said...

Thanks for sharing this blog. It was so informative.
How to prepare for an online interview
Online interviews

Amisina Juniors Academy said...

You wrote this post very carefully. The amount of information is stunning and also a gainful article for us. Keep sharing this kind of articles, Thank you.Learn Python Programming Online in Usa