I'm largely a newbie to ASP.NET Core. I created a Web API template and setup a controller, then manually created the following directory structure under wwwroot:
wwwroot/
css/
site.css
js/
site.js
index.html
When I hit F5, I want to launch index.html in the browser. However, I can't figure out how to do this. Here's my launchSettings.json:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:63123/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "index.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
When I run the "IIS Express" command in Chrome, I get "No webpage was found for the web address: http://localhost:63123/index.html". Why is this happening?
The full source of my app is available here: https://github.com/jamesqo/Decaf/tree/webapp-2/Decaf.WebApp.
I downloaded your code and changed your launchsettings file to the fully qualified url:
"launchUrl": "http://localhost:63123/index.html",
I also amended your StartUp.cs adding (app.UseStaticFiles();) and it now seems to work:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseMvc();
}
Result on running:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With