Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
C# 7 and .NET Core 2.0 Blueprints

You're reading from   C# 7 and .NET Core 2.0 Blueprints Build effective applications that meet modern software requirements

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher
ISBN-13 9781788396196
Length 428 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
 Strauss Strauss
Author Profile Icon Strauss
Strauss
 Rademeyer Rademeyer
Author Profile Icon Rademeyer
Rademeyer
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. eBook Manager and Catalogue App FREE CHAPTER 2. Cricket Score Calculator and Tracker 3. Cross Platform .NET Core System Info Manager 4. Task Bug Logging ASP .NET Core MVC App 5. ASP.NET SignalR Chat Application 6. Web Research Tool with Entity Framework Core 7. A Serverless Email Validation Azure Function 8. Twitter Clone Using OAuth 9. Using Docker and ASP.NET Core 1. Other Books You May Enjoy Index

Showing and telling


It's time. You've created the project, added the libraries, and wrote the code. Now let's see this thing in action.

Running the application

To run the app, hit F5 (or Ctrl + F5 to start without debugging). The app will open in your default browser and you should see this:

Wait. What? We must be missing something here.

Now we could just navigate to the index.html page by changing our URL to localhost:12709/index.html (just check your port number) and we'll be all good.

Instead, let's specify our index.html page as our default launch page.

In the Startup.cs class, in the Configure method, add this line at the top:

app.UseDefaultFiles();

With this little gem, any request to the wwwroot folder (which at any time navigates to your website) will search for one of the following:

  • default.htm
  • default.html
  • index.htm
  • index.html

The first file found will be the file served as your default page. Great!

Now let's run our app again:

Even though our URL still does not show the /index.html part, our...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images