Answer the question
In order to leave comments, you need to log in
ASP Net Core. Why is index.html not showing up?
Good afternoon. Why might html pages added to the project's wwwroot folder not be displayed when run outside of Visual Studio? If you run the project from under the IDE, then the page is shown. If I run from the project folder through the console with the dotnet command, then Hello World is displayed on the screen.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDefaultFiles();
app.UseStaticFiles();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!!");
});
}
Answer the question
In order to leave comments, you need to log in
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!!");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question