Setting index.html as default page in asp.net core

后端 未结 8 656
北荒
北荒 2020-12-30 19:17

How can I get asp.net core to serve an index.html file from inside my wwwroot?

The reason I want to do this is because I an developing an angular 4 app using the ang

8条回答
  •  独厮守ぢ
    2020-12-30 19:50

    return File(System.IO.File.OpenRead(Path.Combine(HostingEnvironment.WebRootPath + "/index.html")), "text/html");
    

    It has to help u

提交回复
热议问题