title: .Net Core 2.0 The view 'Index' was not found
body: <p>I deployed .net core 2.0 application to IIS and I get the following error.</p>
  
  <blockquote>
    <p>InvalidOperationException: The view 'Index' was not found. The following locations were searched: /Views/Home/Index.cshtml /Views/Shared/Index.cshtml</p>
  </blockquote>
  
  <p>This is just a brand new default .net core web template that I am using to test web deploy. I have tried the below code but that doesn't work either.</p>
  
  <pre><code>public static void Main(string[] args)
  {
      new WebHostBuilder()
          .UseKestrel()
          .UseContentRoot(Directory.GetCurrentDirectory())
          .UseStartup&lt;Startup&gt;()
          .Build()
          .Run();
  }
  </code></pre>
  
  <p>Is there a step that I am leaving out</p>
  
  <p><strong>Stack Trace:</strong></p>
  
  <blockquote>
    <p>Message
    InvalidOperationException: The view 'Index' was not found. The following locations were searched:
    /Views/Home/Index.cshtml
    /Views/Shared/Index.cshtml
    Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable originalLocations)</p>
  </blockquote>
  
  <pre><code>InvalidOperationException: The view 'Index' was not found. The following locations were searched: /Views/Home/Index.cshtml /Views/Shared/Index.cshtml
      Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable&lt;string&gt; originalLocations) 
      Microsoft.AspNetCore.Mvc.ViewResult+&lt;ExecuteResultAsync&gt;d__26.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+&lt;InvokeResultAsync&gt;d__19.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+&lt;InvokeNextResultFilterAsync&gt;d__24.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+&lt;InvokeNextResourceFilter&gt;d__22.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+&lt;InvokeFilterPipelineAsync&gt;d__17.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
      Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+&lt;InvokeAsync&gt;d__15.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
      Microsoft.AspNetCore.Builder.RouterMiddleware+&lt;Invoke&gt;d__4.MoveNext() 
      System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
      System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
      Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+&lt;Invoke&gt;d__7.MoveNext() 
  </code></pre>