First, open your Visual Studio to create an MVC application.

Now, click on File => New => Project => ASP.NET MVC 4 Web Application.

MVC

The code given below is used in HomeController.

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. namespace MvcSampleApp.Controllers
  7. {
  8. public class HomeController : Controller
  9. {
  10. public ActionResult Index()
  11. {
  12. return View();
  13. }
  14. }
  15. }

Now, let's see the structure of our application.

MVC

When we are successfully done with publishing, we will see this message in the Output.

MVC

Go to that location and copy the entire application folder. (It is the folder which contains Published Code).

MVC

Now, we need to start the IIS Manager.

Here, you will observe that the published code folder is converted into a website.

MVC


Lastly, right click on that MvcSampleApp and choose "Manage Application" and click on Browse.

Finally, we are done with it. Here is the output after hosting the application on IIS Manager.

MVC

Thank you for reading this article. Happy Coding!!!