I have converted to ASP.NET Core 6.0 and everything now works from VS2022. My root folder is E:\wwwroot along with E:\wwwroot\clientapp\dist for Angular.
However when I deploy to my local IIS, it cannot find the Index.html.
Here is my log:
2022-08-27 13:02:43.790 -04:00 [INF] Starting web site in QA mode
2022-08-27 13:02:43.831 -04:00 [INF] Content Root Dir: E:\wwwroot\
2022-08-27 13:02:43.832 -04:00 [INF] Web Root Dir : E:\wwwroot\
2022-08-27 13:02:43.870 -04:00 [INF] Application started.
Press Ctrl+C to shut down.
2022-08-27 13:02:43.873 -04:00 [INF] Hosting environment:
Production
2022-08-27 13:02:43.874 -04:00 [INF] Content root path: E:\wwwroot\
2022-08-27 13:02:43.893 -04:00 [INF] Request starting HTTP/1.1 GET http://localhost/ - -
2022-08-27 13:02:43.902 -04:00 [INF] No cached response available for this request.
2022-08-27 13:02:43.955 -04:00 [INF] Executing endpoint 'Fallback {*path:nonfile}'
2022-08-27 13:02:43.956 -04:00 [INF] Executed endpoint 'Fallback {*path:nonfile}'
2022-08-27 13:02:43.957 -04:00 [INF] The response could not be cached for this request.
2022-08-27 13:02:43.959 -04:00 [INF] HTTP GET /Index.html responded 404 in 62.0005 ms
2022-08-27 13:02:43.978 -04:00 [INF] Request finished HTTP/1.1 GET http://localhost/ - - 404
2022-08-27 13:02:49.233 -04:00 [INF] Request starting HTTP/1.1 GET http://localhost/index.html - -
2022-08-27 13:02:49.234 -04:00 [INF] No cached response available for this request.
2022-08-27 13:02:49.235 -04:00 [INF] The response could not be cached for this request.
2022-08-27 13:02:49.235 -04:00 [INF] HTTP GET /index.html responded 404 in 1.6585 ms
2022-08-27 13:02:49.236 -04:00 [INF] Request finished HTTP/1.1 GET http://localhost/index.html - - 404
I do not use AddSpaStaticFiles or UseSpa in my program.cs.
I try to browse from application level in IIS or directly at the content view (by clicking on Index.html). Both of these attempts return a 404 error.
Can anybody suggest what I did wrong (or what I am missing?)
Did you remember to install the ASP.NET Core Module/Hosting Bundle
per Host ASP.NET Core on Windows with IIS?
Copying the files to the correct directory isn't enough to integrate IIS to ASP.NET Core. The bundle you install provides an extension to the IIS worker process that allows it to call the ASP.NET Core Kestrel server to serve up ASP.NET Core content.