65.9K
CodeProject is changing. Read more.
Home

Publishing With DNU or DOTNET

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

May 28, 2016

CPOL

2 min read

viewsIcon

6082

How to publish with DNU or DotNet

In this option, we will see how to host the site using DNU option. DNU means DOT NET Utility. DNU is part of the ASP.NET Core ecosystem. Therefore, when we type dnu in command prompt, then it will result in all the required options available as shown below:

264th

One of the commands which do interest me is publish here. DNU is very useful, you can actually script all of these processes and you can actually install all the dependencies and then run the build and then publish to any server, say Test, Staging or even on Release server. Therefore, it provides a mechanism to automate these tasks. Here, we will be applying dnu command at the root of the project folder like shown below with output directory option.

265th

Once the command starts executing, then you will see the below packages are getting copied.

266th

Therefore, this command will run all the required pre-publish commands and will copy all the different pieces to the destination folder. Once, the command gets completed, then it will show similar message as follows.

267th

Now, let us go to the destination folder.

268th

This should look familiar to you as this is the same thing that we have seen in case of publish from Visual Studio. In fact, Visual Studio was just automating the stuff using DNU tool. Now, let us go inside the approot.

269th

Therefore, here also runtime is embedded, now when I type web here, then it will launch the application as shown below:

270th

And, here when I navigate to http://localhost:5000, it will present the same expected result.

Note: This piece is valid for RC1 update. However, if you have upgraded to RC2, then command dnx is renamed to dotnet. You can refer the complete list at https://docs.efproject.net/en/latest/miscellaneous/rc1-rc2-upgrade.html.

I hope you would have liked today’s discussion. Thanks for joining me.

Happy coding!

327 total views, 3 views today