ASP.NET Core can't find view when integrated to IIS
<p>I have built an ASP.NET Core application and want to rollout this app on my Win2008 server. If I start the application directly in kestrel (double click on the exe which contains the main) everything works fine. However if I start the application via IIS I get the following exception:</p>

<blockquote>
  <p>fail: Microsoft.AspNetCore.Server.Kestrel[13]
        Connection id "0HKU0DCR0LPSS": An unhandled exception was thrown by the application. System.InvalidOperationException: The view 'Login'
  was not found. The following locations were searched:
  /Views/Account/Login.cshtml /Views/Shared/Login.cshtml    at
  Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable`1
  originalLocations)    at
  Microsoft.AspNetCore.Mvc.ViewResult.d__26.MoveNext()</p>
</blockquote>

<p>Exactly this exception was already discussed in this <a href="https://stackoverflow.com/questions/37529040/how-do-i-solve-a-view-not-found-exception-in-asp-net-core-mvc-project">question</a>. But I compared my files with the proposed solution and still get the error. </p>

<p>I have also noticed that a configuration file which was originally placed next to the application.exe has to be moved inside the wwwroot folder if I start the app via IIS.</p>

<p>Here is the content of my web.config which sits inside the wwwroot folder: </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;configuration&gt;
  &lt;system.webServer&gt;
    &lt;handlers&gt;
      &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /&gt;
    &lt;/handlers&gt;
    &lt;aspNetCore processPath="..\ERMSClient.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout" /&gt;
  &lt;/system.webServer&gt;
&lt;/configuration&gt; 
</code></pre>

<p>And this is my project.json</p>

<pre><code>{
  "dependencies": {
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
    "Microsoft.EntityFrameworkCore": "1.0.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
    "Microsoft.AspNetCore.Server.WebListener": "0.1.0",
    "Microsoft.AspNetCore.Http": "1.0.0",
    "Microsoft.AspNetCore.Authorization": "1.0.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
    "Microsoft.AspNetCore.Mvc.Core": "1.0.0",
    "Microsoft.AspNetCore.Mvc.ApiExplorer": "1.0.0",
    "Microsoft.AspNetCore.Mvc.Abstractions": "1.0.0",
    "Microsoft.AspNetCore.Session": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Newtonsoft.Json": "9.0.1",
    "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "System.Web.Helpers.dll": "1.0.0",
    "AutoMapper": "5.0.2",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview2-final",
    "Microsoft.Extensions.Configuration": "1.0.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0"
  },
  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "net461": {
      "dependencies": {
        "d3Communicator": {
          "target": "project"
        }
      }
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },
  "scripts": {
    "prepublish": [ "npm install", "bower install" ],
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }
}
</code></pre>

<p>In addition I have to mention that I have upgraded this project from ASP.NET RC1. Therefore I have perhaps an old entry or something else somewhere. </p>