title: Razor view with asp.net core not working
body: <p>I'm still trying to get my head around asp.net core so this may be a stupid question but I can't get a razor view to work with asp.net core mvc.</p>
  
  <p>I'm getting a 500 error when I'm trying to return a view and not getting anything useful in the console logging.</p>
  
  <p>My project.json:</p>
  
  <pre><code>{
    "version": "1.0.0-*",
    "buildOptions": {
      "debugType": "portable",
      "emitEntryPoint": true
    },
    "dependencies": {},
    "frameworks": {
      "netcoreapp1.0": {
        "dependencies": {
          "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.1"
          },
          "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
          "Microsoft.AspNetCore.Mvc": "1.0.1",
          "Microsoft.Extensions.DependencyInjection": "1.0.0",
  
          "Microsoft.AspNetCore.Mvc.Razor": "1.0.1",
          "Microsoft.AspNetCore.StaticFiles": "1.0.0",
          "Microsoft.Extensions.Logging.Console": "1.0.0"
        },
        "imports": "dnxcore50"
      }
    }
  }
  </code></pre>
  
  <p>Program.cs:</p>
  
  <pre><code>using System;
  using System.IO;
  using Microsoft.AspNetCore.Hosting;
  
  namespace aspnetcoreapp
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              var host = new WebHostBuilder()
                  .UseKestrel()
                  .UseContentRoot(Directory.GetCurrentDirectory())
                  .UseStartup&lt;Startup&gt;()
                  .Build();
  
              host.Run();
          }
      }
  }
  </code></pre>
  
  <p>Startup.cs:</p>
  
  <pre><code>using System;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Http;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.AspNetCore.StaticFiles;
  using Microsoft.Extensions.Logging;
  
  namespace aspnetcoreapp
  {
      public class Startup
      {
          public void ConfigureServices(IServiceCollection services)
          {
              services.AddMvc();
          }
  
          public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
          {
              loggerFactory.AddConsole(LogLevel.Debug);
  
              app.UseStaticFiles();
  
              app.UseMvc(routes =&gt;
              {
              routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}");
              });
  
              app.Run(context =&gt;
              {
                  return context.Response.WriteAsync("Hello from ASP.NET Core!");
              });
          }
      }
  }
  </code></pre>
  
  <p>Home.cs:</p>
  
  <pre><code>using Microsoft.AspNetCore.Mvc;
  //using System.Text.Encodings.Web;
  
  namespace MvcMovie.Controllers
  {
      public class HomeController : Controller
      {
          // 
          // GET: /HelloWorld/
  
          public IActionResult Index()
          {
              return View();
          }
  
          // 
          // GET: /HelloWorld/Welcome/ 
  
          public string Welcome()
          {
              return "This is the home Welcome action method...";
          }
      }
  }
  </code></pre>
  
  <p>and I have a basic view in /Views/Home/Index.cshtml</p>
  
  <p>any help would be greatly appreciated.</p>
  
  <p>thanks</p>