{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/1514","repository_url":"https://api.github.com/repos/aspnet/JavaScriptServices","labels_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/1514/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/1514/comments","events_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/1514/events","html_url":"https://github.com/aspnet/JavaScriptServices/issues/1514","id":293958422,"number":1514,"title":"The SPA default page middleware could not return the default page '/index.html' not found when  using 2.0.0-rc1-final","user":{"login":"jrmcdona","id":4327773,"avatar_url":"https://avatars3.githubusercontent.com/u/4327773?v=4","gravatar_id":"","url":"https://api.github.com/users/jrmcdona","html_url":"https://github.com/jrmcdona","followers_url":"https://api.github.com/users/jrmcdona/followers","following_url":"https://api.github.com/users/jrmcdona/following{/other_user}","gists_url":"https://api.github.com/users/jrmcdona/gists{/gist_id}","starred_url":"https://api.github.com/users/jrmcdona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrmcdona/subscriptions","organizations_url":"https://api.github.com/users/jrmcdona/orgs","repos_url":"https://api.github.com/users/jrmcdona/repos","events_url":"https://api.github.com/users/jrmcdona/events{/privacy}","received_events_url":"https://api.github.com/users/jrmcdona/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-02-02T17:07:38Z","updated_at":"2018-05-27T04:47:25Z","closed_at":"2018-02-07T14:18:39Z","author_association":"NONE","body":"I created a project with \r\ndotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0-rc1-final\r\ndotnet new angular\r\n\r\nHere is the error:\r\n\r\n```\r\nApplication started. Press Ctrl+C to shut down.\r\nfail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]\r\n      An unhandled exception has occurred: The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\nfail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]\r\n      An exception was thrown attempting to execute the error handler.\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\nfail: Microsoft.AspNetCore.Server.Kestrel[13]\r\n      Connection id \"0HLBABQBRVS28\", Request id \"0HLBABQBRVS28:00000001\": An unhandled exception was thrown by the application.\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()\r\nfail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]\r\n      An unhandled exception has occurred: The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\nfail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]\r\n      An exception was thrown attempting to execute the error handler.\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\nfail: Microsoft.AspNetCore.Server.Kestrel[13]\r\n      Connection id \"0HLBABQBRVS2A\", Request id \"0HLBABQBRVS2A:00000001\": An unhandled exception was thrown by the application.\r\nSystem.InvalidOperationException: The SPA default page middleware could not return the default page '/index.html' because it was not found,\r\nand no other middleware handled the request.\r\nYour application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively\r\nyou may wish to switch to the Development environment.\r\n\r\n   at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, Func`1 next)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/comments/392305085","html_url":"https://github.com/aspnet/JavaScriptServices/issues/1514#issuecomment-392305085","issue_url":"https://api.github.com/repos/aspnet/JavaScriptServices/issues/1514","id":392305085,"user":{"login":"LeandroCarvalho","id":5206046,"avatar_url":"https://avatars1.githubusercontent.com/u/5206046?v=4","gravatar_id":"","url":"https://api.github.com/users/LeandroCarvalho","html_url":"https://github.com/LeandroCarvalho","followers_url":"https://api.github.com/users/LeandroCarvalho/followers","following_url":"https://api.github.com/users/LeandroCarvalho/following{/other_user}","gists_url":"https://api.github.com/users/LeandroCarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/LeandroCarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeandroCarvalho/subscriptions","organizations_url":"https://api.github.com/users/LeandroCarvalho/orgs","repos_url":"https://api.github.com/users/LeandroCarvalho/repos","events_url":"https://api.github.com/users/LeandroCarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/LeandroCarvalho/received_events","type":"User","site_admin":false},"created_at":"2018-05-27T04:47:25Z","updated_at":"2018-05-27T04:47:25Z","author_association":"NONE","body":"He had the same problem.\r\n\r\nThe error occurred because the dist folder is not created in ClientApp, see configuration.\r\n\r\n         public void ConfigureServices (IServiceCollection services)\r\n         {\r\n             services.AddMvc ();\r\n\r\n             // In production, the Angular files will be served from this directory\r\n             services.AddSpaStaticFiles (configuration =>\r\n             {\r\n                 configuration.RootPath = \"ClientApp/dist\";\r\n             });\r\n         }\r\n\r\nRemember that this setting is of production, probably the ASPNETCORE_Environment=Development variable was not created correctly\r\n\r\nTo solve the problem I installed the global cli \"npm install - g @angular/cli\" and executed the ng build command in the ClientApp folder"}}
{"actor":{"display_login":"LeandroCarvalho"}}