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
  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 core application running while never had to leave the command prompt.


isabellaJoseph 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

devo 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

Careen joseph 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

giselle aga 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

Adlina Jessi 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

ASO Services said...

Good post and I like it very much. By the way, anybody try this app development company for iOS and Android? I find it is so professional to help me boost app ranking and increase app downloads.

John Alert said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from .Net Core Training in Chennai. or learn thru .Net Core Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Es6 Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

JamesWilliam said...

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

Rajesh said...

Thanks for one marvelous posting! I enjoyed reading it;Great post.The information was very useful.Keep the good work goin on!!
Hadoop training in chennai | Mainframe training in chennai | SAP SD training in 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

aravindsai said...

Great posting with useful topics.Thank you.
PHP Online Training
Pega Online Training
Oracle Soa Online Training

sri krishna kumar said...

A very interesting case study
Sap MM Training In Chennai | Mainframe Training In Chennai | Hadoop Training In Chennai

JamesWilliam said...

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

sumathi s 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

krishna swamy 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

kalai hai 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 Karthik 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

pavithra dass said...

The post you wrote which is full of informative content. I Like it very much. Keep on posting!!
German Classes in Chennai
German Language Classes in Chennai
Angularjs Training in Chennai
Selenium Training in Chennai
Software Testing Training in Chennai
German classes in Anna Nagar
German classes in Velachery

Aditi Ray said...

Thank you for sharing this Information.
Check out the best
home office desks nz
coffee table nz
balance bike

Aparna said...

Outstanding post and Thank you for sharing such useful information with us. Keep blogging...

Pega Training in Chennai
Pega Training
Spark Training in Chennai
Oracle DBA Training in Chennai
Excel Training in Chennai
Embedded System Course Chennai
Tableau Training in Chennai
Power BI Training in Chennai
Unix Training in Chennai
Job Openings in Chennai

velraj said...

Great experience for me by reading this blog. Nice Article.

Ethical Hacking course in Chennai
Ethical Hacking Training in Chennai
Hacking course in Chennai
ccna course in Chennai
Salesforce Training in Chennai
AngularJS Training in Chennai
PHP Training in Chennai
Ethical Hacking course in Tambaram
Ethical Hacking course in Velachery
Ethical Hacking course in T Nagar